1#![doc = "MAVLink cubepilot dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
21#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
22#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23#[cfg_attr(feature = "serde", serde(tag = "type"))]
24#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25#[repr(u32)]
26#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
27pub enum ActuatorConfiguration {
28 #[doc = "Do nothing."]
29 ACTUATOR_CONFIGURATION_NONE = 0,
30 #[doc = "Command the actuator to beep now."]
31 ACTUATOR_CONFIGURATION_BEEP = 1,
32 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
33 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
34 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
35 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
36 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
37 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
38 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
39 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
40}
41impl ActuatorConfiguration {
42 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
43}
44impl Default for ActuatorConfiguration {
45 fn default() -> Self {
46 Self::DEFAULT
47 }
48}
49#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
50#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
51#[cfg_attr(feature = "serde", serde(tag = "type"))]
52#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
53#[repr(u32)]
54#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
55pub enum ActuatorOutputFunction {
56 #[doc = "No function (disabled)."]
57 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
58 #[doc = "Motor 1"]
59 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
60 #[doc = "Motor 2"]
61 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
62 #[doc = "Motor 3"]
63 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
64 #[doc = "Motor 4"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
66 #[doc = "Motor 5"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
68 #[doc = "Motor 6"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
70 #[doc = "Motor 7"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
72 #[doc = "Motor 8"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
74 #[doc = "Motor 9"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
76 #[doc = "Motor 10"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
78 #[doc = "Motor 11"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
80 #[doc = "Motor 12"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
82 #[doc = "Motor 13"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
84 #[doc = "Motor 14"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
86 #[doc = "Motor 15"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
88 #[doc = "Motor 16"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
90 #[doc = "Servo 1"]
91 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
92 #[doc = "Servo 2"]
93 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
94 #[doc = "Servo 3"]
95 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
96 #[doc = "Servo 4"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
98 #[doc = "Servo 5"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
100 #[doc = "Servo 6"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
102 #[doc = "Servo 7"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
104 #[doc = "Servo 8"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
106 #[doc = "Servo 9"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
108 #[doc = "Servo 10"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
110 #[doc = "Servo 11"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
112 #[doc = "Servo 12"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
114 #[doc = "Servo 13"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
116 #[doc = "Servo 14"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
118 #[doc = "Servo 15"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
120 #[doc = "Servo 16"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
122}
123impl ActuatorOutputFunction {
124 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
125}
126impl Default for ActuatorOutputFunction {
127 fn default() -> Self {
128 Self::DEFAULT
129 }
130}
131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
133#[cfg_attr(feature = "serde", serde(tag = "type"))]
134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
135#[repr(u32)]
136#[doc = "Enumeration of the ADSB altimeter types"]
137pub enum AdsbAltitudeType {
138 #[doc = "Altitude reported from a Baro source using QNH reference"]
139 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
140 #[doc = "Altitude reported from a GNSS source"]
141 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
142}
143impl AdsbAltitudeType {
144 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
145}
146impl Default for AdsbAltitudeType {
147 fn default() -> Self {
148 Self::DEFAULT
149 }
150}
151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
153#[cfg_attr(feature = "serde", serde(tag = "type"))]
154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
155#[repr(u32)]
156#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
157pub enum AdsbEmitterType {
158 ADSB_EMITTER_TYPE_NO_INFO = 0,
159 ADSB_EMITTER_TYPE_LIGHT = 1,
160 ADSB_EMITTER_TYPE_SMALL = 2,
161 ADSB_EMITTER_TYPE_LARGE = 3,
162 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
163 ADSB_EMITTER_TYPE_HEAVY = 5,
164 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
165 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
166 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
167 ADSB_EMITTER_TYPE_GLIDER = 9,
168 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
169 ADSB_EMITTER_TYPE_PARACHUTE = 11,
170 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
171 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
172 ADSB_EMITTER_TYPE_UAV = 14,
173 ADSB_EMITTER_TYPE_SPACE = 15,
174 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
175 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
176 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
177 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
178}
179impl AdsbEmitterType {
180 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
181}
182impl Default for AdsbEmitterType {
183 fn default() -> Self {
184 Self::DEFAULT
185 }
186}
187bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
188impl AdsbFlags {
189 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
190}
191impl Default for AdsbFlags {
192 fn default() -> Self {
193 Self::DEFAULT
194 }
195}
196bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
197impl AisFlags {
198 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
199}
200impl Default for AisFlags {
201 fn default() -> Self {
202 Self::DEFAULT
203 }
204}
205#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
207#[cfg_attr(feature = "serde", serde(tag = "type"))]
208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
209#[repr(u32)]
210#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
211pub enum AisNavStatus {
212 #[doc = "Under way using engine."]
213 UNDER_WAY = 0,
214 AIS_NAV_ANCHORED = 1,
215 AIS_NAV_UN_COMMANDED = 2,
216 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
217 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
218 AIS_NAV_MOORED = 5,
219 AIS_NAV_AGROUND = 6,
220 AIS_NAV_FISHING = 7,
221 AIS_NAV_SAILING = 8,
222 AIS_NAV_RESERVED_HSC = 9,
223 AIS_NAV_RESERVED_WIG = 10,
224 AIS_NAV_RESERVED_1 = 11,
225 AIS_NAV_RESERVED_2 = 12,
226 AIS_NAV_RESERVED_3 = 13,
227 #[doc = "Search And Rescue Transponder."]
228 AIS_NAV_AIS_SART = 14,
229 #[doc = "Not available (default)."]
230 AIS_NAV_UNKNOWN = 15,
231}
232impl AisNavStatus {
233 pub const DEFAULT: Self = Self::UNDER_WAY;
234}
235impl Default for AisNavStatus {
236 fn default() -> Self {
237 Self::DEFAULT
238 }
239}
240#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
242#[cfg_attr(feature = "serde", serde(tag = "type"))]
243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
244#[repr(u32)]
245#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
246pub enum AisType {
247 #[doc = "Not available (default)."]
248 AIS_TYPE_UNKNOWN = 0,
249 AIS_TYPE_RESERVED_1 = 1,
250 AIS_TYPE_RESERVED_2 = 2,
251 AIS_TYPE_RESERVED_3 = 3,
252 AIS_TYPE_RESERVED_4 = 4,
253 AIS_TYPE_RESERVED_5 = 5,
254 AIS_TYPE_RESERVED_6 = 6,
255 AIS_TYPE_RESERVED_7 = 7,
256 AIS_TYPE_RESERVED_8 = 8,
257 AIS_TYPE_RESERVED_9 = 9,
258 AIS_TYPE_RESERVED_10 = 10,
259 AIS_TYPE_RESERVED_11 = 11,
260 AIS_TYPE_RESERVED_12 = 12,
261 AIS_TYPE_RESERVED_13 = 13,
262 AIS_TYPE_RESERVED_14 = 14,
263 AIS_TYPE_RESERVED_15 = 15,
264 AIS_TYPE_RESERVED_16 = 16,
265 AIS_TYPE_RESERVED_17 = 17,
266 AIS_TYPE_RESERVED_18 = 18,
267 AIS_TYPE_RESERVED_19 = 19,
268 #[doc = "Wing In Ground effect."]
269 AIS_TYPE_WIG = 20,
270 AIS_TYPE_WIG_HAZARDOUS_A = 21,
271 AIS_TYPE_WIG_HAZARDOUS_B = 22,
272 AIS_TYPE_WIG_HAZARDOUS_C = 23,
273 AIS_TYPE_WIG_HAZARDOUS_D = 24,
274 AIS_TYPE_WIG_RESERVED_1 = 25,
275 AIS_TYPE_WIG_RESERVED_2 = 26,
276 AIS_TYPE_WIG_RESERVED_3 = 27,
277 AIS_TYPE_WIG_RESERVED_4 = 28,
278 AIS_TYPE_WIG_RESERVED_5 = 29,
279 AIS_TYPE_FISHING = 30,
280 AIS_TYPE_TOWING = 31,
281 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
282 AIS_TYPE_TOWING_LARGE = 32,
283 #[doc = "Dredging or other underwater ops."]
284 AIS_TYPE_DREDGING = 33,
285 AIS_TYPE_DIVING = 34,
286 AIS_TYPE_MILITARY = 35,
287 AIS_TYPE_SAILING = 36,
288 AIS_TYPE_PLEASURE = 37,
289 AIS_TYPE_RESERVED_20 = 38,
290 AIS_TYPE_RESERVED_21 = 39,
291 #[doc = "High Speed Craft."]
292 AIS_TYPE_HSC = 40,
293 AIS_TYPE_HSC_HAZARDOUS_A = 41,
294 AIS_TYPE_HSC_HAZARDOUS_B = 42,
295 AIS_TYPE_HSC_HAZARDOUS_C = 43,
296 AIS_TYPE_HSC_HAZARDOUS_D = 44,
297 AIS_TYPE_HSC_RESERVED_1 = 45,
298 AIS_TYPE_HSC_RESERVED_2 = 46,
299 AIS_TYPE_HSC_RESERVED_3 = 47,
300 AIS_TYPE_HSC_RESERVED_4 = 48,
301 AIS_TYPE_HSC_UNKNOWN = 49,
302 AIS_TYPE_PILOT = 50,
303 #[doc = "Search And Rescue vessel."]
304 AIS_TYPE_SAR = 51,
305 AIS_TYPE_TUG = 52,
306 AIS_TYPE_PORT_TENDER = 53,
307 #[doc = "Anti-pollution equipment."]
308 AIS_TYPE_ANTI_POLLUTION = 54,
309 AIS_TYPE_LAW_ENFORCEMENT = 55,
310 AIS_TYPE_SPARE_LOCAL_1 = 56,
311 AIS_TYPE_SPARE_LOCAL_2 = 57,
312 AIS_TYPE_MEDICAL_TRANSPORT = 58,
313 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
314 AIS_TYPE_NONECOMBATANT = 59,
315 AIS_TYPE_PASSENGER = 60,
316 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
317 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
318 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
319 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
320 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
321 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
322 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
323 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
324 AIS_TYPE_PASSENGER_UNKNOWN = 69,
325 AIS_TYPE_CARGO = 70,
326 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
327 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
328 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
329 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
330 AIS_TYPE_CARGO_RESERVED_1 = 75,
331 AIS_TYPE_CARGO_RESERVED_2 = 76,
332 AIS_TYPE_CARGO_RESERVED_3 = 77,
333 AIS_TYPE_CARGO_RESERVED_4 = 78,
334 AIS_TYPE_CARGO_UNKNOWN = 79,
335 AIS_TYPE_TANKER = 80,
336 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
337 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
338 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
339 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
340 AIS_TYPE_TANKER_RESERVED_1 = 85,
341 AIS_TYPE_TANKER_RESERVED_2 = 86,
342 AIS_TYPE_TANKER_RESERVED_3 = 87,
343 AIS_TYPE_TANKER_RESERVED_4 = 88,
344 AIS_TYPE_TANKER_UNKNOWN = 89,
345 AIS_TYPE_OTHER = 90,
346 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
347 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
348 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
349 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
350 AIS_TYPE_OTHER_RESERVED_1 = 95,
351 AIS_TYPE_OTHER_RESERVED_2 = 96,
352 AIS_TYPE_OTHER_RESERVED_3 = 97,
353 AIS_TYPE_OTHER_RESERVED_4 = 98,
354 AIS_TYPE_OTHER_UNKNOWN = 99,
355}
356impl AisType {
357 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
358}
359impl Default for AisType {
360 fn default() -> Self {
361 Self::DEFAULT
362 }
363}
364bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
365impl AttitudeTargetTypemask {
366 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
367}
368impl Default for AttitudeTargetTypemask {
369 fn default() -> Self {
370 Self::DEFAULT
371 }
372}
373#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
375#[cfg_attr(feature = "serde", serde(tag = "type"))]
376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
377#[repr(u32)]
378#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
379pub enum AutotuneAxis {
380 #[doc = "Autotune roll axis."]
381 AUTOTUNE_AXIS_ROLL = 1,
382 #[doc = "Autotune pitch axis."]
383 AUTOTUNE_AXIS_PITCH = 2,
384 #[doc = "Autotune yaw axis."]
385 AUTOTUNE_AXIS_YAW = 4,
386}
387impl AutotuneAxis {
388 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
389}
390impl Default for AutotuneAxis {
391 fn default() -> Self {
392 Self::DEFAULT
393 }
394}
395bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
396impl CameraCapFlags {
397 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
398}
399impl Default for CameraCapFlags {
400 fn default() -> Self {
401 Self::DEFAULT
402 }
403}
404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
406#[cfg_attr(feature = "serde", serde(tag = "type"))]
407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
408#[repr(u32)]
409#[doc = "Camera Modes."]
410pub enum CameraMode {
411 #[doc = "Camera is in image/photo capture mode."]
412 CAMERA_MODE_IMAGE = 0,
413 #[doc = "Camera is in video capture mode."]
414 CAMERA_MODE_VIDEO = 1,
415 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
416 CAMERA_MODE_IMAGE_SURVEY = 2,
417}
418impl CameraMode {
419 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
420}
421impl Default for CameraMode {
422 fn default() -> Self {
423 Self::DEFAULT
424 }
425}
426#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
428#[cfg_attr(feature = "serde", serde(tag = "type"))]
429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
430#[repr(u32)]
431#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
432pub enum CameraSource {
433 #[doc = "Default camera source."]
434 CAMERA_SOURCE_DEFAULT = 0,
435 #[doc = "RGB camera source."]
436 CAMERA_SOURCE_RGB = 1,
437 #[doc = "IR camera source."]
438 CAMERA_SOURCE_IR = 2,
439 #[doc = "NDVI camera source."]
440 CAMERA_SOURCE_NDVI = 3,
441}
442impl CameraSource {
443 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
444}
445impl Default for CameraSource {
446 fn default() -> Self {
447 Self::DEFAULT
448 }
449}
450#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
452#[cfg_attr(feature = "serde", serde(tag = "type"))]
453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
454#[repr(u32)]
455#[doc = "Camera tracking modes"]
456pub enum CameraTrackingMode {
457 #[doc = "Not tracking"]
458 CAMERA_TRACKING_MODE_NONE = 0,
459 #[doc = "Target is a point"]
460 CAMERA_TRACKING_MODE_POINT = 1,
461 #[doc = "Target is a rectangle"]
462 CAMERA_TRACKING_MODE_RECTANGLE = 2,
463}
464impl CameraTrackingMode {
465 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
466}
467impl Default for CameraTrackingMode {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking status flags"]
478pub enum CameraTrackingStatusFlags {
479 #[doc = "Camera is not tracking"]
480 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
481 #[doc = "Camera is tracking"]
482 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
483 #[doc = "Camera tracking in error state"]
484 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
485}
486impl CameraTrackingStatusFlags {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
488}
489impl Default for CameraTrackingStatusFlags {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
495impl CameraTrackingTargetData {
496 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
497}
498impl Default for CameraTrackingTargetData {
499 fn default() -> Self {
500 Self::DEFAULT
501 }
502}
503#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
505#[cfg_attr(feature = "serde", serde(tag = "type"))]
506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
507#[repr(u32)]
508#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
509pub enum CameraZoomType {
510 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
511 ZOOM_TYPE_STEP = 0,
512 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
513 ZOOM_TYPE_CONTINUOUS = 1,
514 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
515 ZOOM_TYPE_RANGE = 2,
516 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
517 ZOOM_TYPE_FOCAL_LENGTH = 3,
518 #[doc = "Zoom value as horizontal field of view in degrees."]
519 ZOOM_TYPE_HORIZONTAL_FOV = 4,
520}
521impl CameraZoomType {
522 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
523}
524impl Default for CameraZoomType {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534pub enum CanFilterOp {
535 CAN_FILTER_REPLACE = 0,
536 CAN_FILTER_ADD = 1,
537 CAN_FILTER_REMOVE = 2,
538}
539impl CanFilterOp {
540 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
541}
542impl Default for CanFilterOp {
543 fn default() -> Self {
544 Self::DEFAULT
545 }
546}
547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
549#[cfg_attr(feature = "serde", serde(tag = "type"))]
550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
551#[repr(u32)]
552#[doc = "Possible responses from a CELLULAR_CONFIG message."]
553pub enum CellularConfigResponse {
554 #[doc = "Changes accepted."]
555 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
556 #[doc = "Invalid APN."]
557 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
558 #[doc = "Invalid PIN."]
559 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
560 #[doc = "Changes rejected."]
561 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
562 #[doc = "PUK is required to unblock SIM card."]
563 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
564}
565impl CellularConfigResponse {
566 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
567}
568impl Default for CellularConfigResponse {
569 fn default() -> Self {
570 Self::DEFAULT
571 }
572}
573#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
575#[cfg_attr(feature = "serde", serde(tag = "type"))]
576#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
577#[repr(u32)]
578#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
579pub enum CellularNetworkFailedReason {
580 #[doc = "No error"]
581 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
582 #[doc = "Error state is unknown"]
583 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
584 #[doc = "SIM is required for the modem but missing"]
585 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
586 #[doc = "SIM is available, but not usable for connection"]
587 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
588}
589impl CellularNetworkFailedReason {
590 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
591}
592impl Default for CellularNetworkFailedReason {
593 fn default() -> Self {
594 Self::DEFAULT
595 }
596}
597#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
599#[cfg_attr(feature = "serde", serde(tag = "type"))]
600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
601#[repr(u32)]
602#[doc = "Cellular network radio type"]
603pub enum CellularNetworkRadioType {
604 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
605 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
606 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
607 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
608 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
609}
610impl CellularNetworkRadioType {
611 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
612}
613impl Default for CellularNetworkRadioType {
614 fn default() -> Self {
615 Self::DEFAULT
616 }
617}
618#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
620#[cfg_attr(feature = "serde", serde(tag = "type"))]
621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
622#[repr(u32)]
623#[doc = "These flags encode the cellular network status"]
624pub enum CellularStatusFlag {
625 #[doc = "State unknown or not reportable."]
626 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
627 #[doc = "Modem is unusable"]
628 CELLULAR_STATUS_FLAG_FAILED = 1,
629 #[doc = "Modem is being initialized"]
630 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
631 #[doc = "Modem is locked"]
632 CELLULAR_STATUS_FLAG_LOCKED = 3,
633 #[doc = "Modem is not enabled and is powered down"]
634 CELLULAR_STATUS_FLAG_DISABLED = 4,
635 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
636 CELLULAR_STATUS_FLAG_DISABLING = 5,
637 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
638 CELLULAR_STATUS_FLAG_ENABLING = 6,
639 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
640 CELLULAR_STATUS_FLAG_ENABLED = 7,
641 #[doc = "Modem is searching for a network provider to register"]
642 CELLULAR_STATUS_FLAG_SEARCHING = 8,
643 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
644 CELLULAR_STATUS_FLAG_REGISTERED = 9,
645 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
646 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
647 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
648 CELLULAR_STATUS_FLAG_CONNECTING = 11,
649 #[doc = "One or more packet data bearers is active and connected"]
650 CELLULAR_STATUS_FLAG_CONNECTED = 12,
651}
652impl CellularStatusFlag {
653 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
654}
655impl Default for CellularStatusFlag {
656 fn default() -> Self {
657 Self::DEFAULT
658 }
659}
660#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
662#[cfg_attr(feature = "serde", serde(tag = "type"))]
663#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
664#[repr(u32)]
665#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
666pub enum CompMetadataType {
667 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
668 COMP_METADATA_TYPE_GENERAL = 0,
669 #[doc = "Parameter meta data."]
670 COMP_METADATA_TYPE_PARAMETER = 1,
671 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
672 COMP_METADATA_TYPE_COMMANDS = 2,
673 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
674 COMP_METADATA_TYPE_PERIPHERALS = 3,
675 #[doc = "Meta data for the events interface."]
676 COMP_METADATA_TYPE_EVENTS = 4,
677 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
678 COMP_METADATA_TYPE_ACTUATORS = 5,
679}
680impl CompMetadataType {
681 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
682}
683impl Default for CompMetadataType {
684 fn default() -> Self {
685 Self::DEFAULT
686 }
687}
688#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
690#[cfg_attr(feature = "serde", serde(tag = "type"))]
691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
692#[repr(u32)]
693#[doc = "Indicates the ESC connection type."]
694pub enum EscConnectionType {
695 #[doc = "Traditional PPM ESC."]
696 ESC_CONNECTION_TYPE_PPM = 0,
697 #[doc = "Serial Bus connected ESC."]
698 ESC_CONNECTION_TYPE_SERIAL = 1,
699 #[doc = "One Shot PPM ESC."]
700 ESC_CONNECTION_TYPE_ONESHOT = 2,
701 #[doc = "I2C ESC."]
702 ESC_CONNECTION_TYPE_I2C = 3,
703 #[doc = "CAN-Bus ESC."]
704 ESC_CONNECTION_TYPE_CAN = 4,
705 #[doc = "DShot ESC."]
706 ESC_CONNECTION_TYPE_DSHOT = 5,
707}
708impl EscConnectionType {
709 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
710}
711impl Default for EscConnectionType {
712 fn default() -> Self {
713 Self::DEFAULT
714 }
715}
716bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
717impl EscFailureFlags {
718 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
719}
720impl Default for EscFailureFlags {
721 fn default() -> Self {
722 Self::DEFAULT
723 }
724}
725bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
726impl EstimatorStatusFlags {
727 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
728}
729impl Default for EstimatorStatusFlags {
730 fn default() -> Self {
731 Self::DEFAULT
732 }
733}
734#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
736#[cfg_attr(feature = "serde", serde(tag = "type"))]
737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
738#[repr(u32)]
739#[doc = "List of possible failure type to inject."]
740pub enum FailureType {
741 #[doc = "No failure injected, used to reset a previous failure."]
742 FAILURE_TYPE_OK = 0,
743 #[doc = "Sets unit off, so completely non-responsive."]
744 FAILURE_TYPE_OFF = 1,
745 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
746 FAILURE_TYPE_STUCK = 2,
747 #[doc = "Unit is reporting complete garbage."]
748 FAILURE_TYPE_GARBAGE = 3,
749 #[doc = "Unit is consistently wrong."]
750 FAILURE_TYPE_WRONG = 4,
751 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
752 FAILURE_TYPE_SLOW = 5,
753 #[doc = "Data of unit is delayed in time."]
754 FAILURE_TYPE_DELAYED = 6,
755 #[doc = "Unit is sometimes working, sometimes not."]
756 FAILURE_TYPE_INTERMITTENT = 7,
757}
758impl FailureType {
759 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
760}
761impl Default for FailureType {
762 fn default() -> Self {
763 Self::DEFAULT
764 }
765}
766#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
768#[cfg_attr(feature = "serde", serde(tag = "type"))]
769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
770#[repr(u32)]
771#[doc = "List of possible units where failures can be injected."]
772pub enum FailureUnit {
773 FAILURE_UNIT_SENSOR_GYRO = 0,
774 FAILURE_UNIT_SENSOR_ACCEL = 1,
775 FAILURE_UNIT_SENSOR_MAG = 2,
776 FAILURE_UNIT_SENSOR_BARO = 3,
777 FAILURE_UNIT_SENSOR_GPS = 4,
778 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
779 FAILURE_UNIT_SENSOR_VIO = 6,
780 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
781 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
782 FAILURE_UNIT_SYSTEM_BATTERY = 100,
783 FAILURE_UNIT_SYSTEM_MOTOR = 101,
784 FAILURE_UNIT_SYSTEM_SERVO = 102,
785 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
786 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
787 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
788}
789impl FailureUnit {
790 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
791}
792impl Default for FailureUnit {
793 fn default() -> Self {
794 Self::DEFAULT
795 }
796}
797#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
799#[cfg_attr(feature = "serde", serde(tag = "type"))]
800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
801#[repr(u32)]
802pub enum FenceBreach {
803 #[doc = "No last fence breach"]
804 FENCE_BREACH_NONE = 0,
805 #[doc = "Breached minimum altitude"]
806 FENCE_BREACH_MINALT = 1,
807 #[doc = "Breached maximum altitude"]
808 FENCE_BREACH_MAXALT = 2,
809 #[doc = "Breached fence boundary"]
810 FENCE_BREACH_BOUNDARY = 3,
811}
812impl FenceBreach {
813 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
814}
815impl Default for FenceBreach {
816 fn default() -> Self {
817 Self::DEFAULT
818 }
819}
820#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
822#[cfg_attr(feature = "serde", serde(tag = "type"))]
823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
824#[repr(u32)]
825#[doc = "Actions being taken to mitigate/prevent fence breach"]
826pub enum FenceMitigate {
827 #[doc = "Unknown"]
828 FENCE_MITIGATE_UNKNOWN = 0,
829 #[doc = "No actions being taken"]
830 FENCE_MITIGATE_NONE = 1,
831 #[doc = "Velocity limiting active to prevent breach"]
832 FENCE_MITIGATE_VEL_LIMIT = 2,
833}
834impl FenceMitigate {
835 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
836}
837impl Default for FenceMitigate {
838 fn default() -> Self {
839 Self::DEFAULT
840 }
841}
842#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
844#[cfg_attr(feature = "serde", serde(tag = "type"))]
845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
846#[repr(u32)]
847#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
848pub enum FenceType {
849 #[doc = "Maximum altitude fence"]
850 FENCE_TYPE_ALT_MAX = 1,
851 #[doc = "Circle fence"]
852 FENCE_TYPE_CIRCLE = 2,
853 #[doc = "Polygon fence"]
854 FENCE_TYPE_POLYGON = 4,
855 #[doc = "Minimum altitude fence"]
856 FENCE_TYPE_ALT_MIN = 8,
857}
858impl FenceType {
859 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
860}
861impl Default for FenceType {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
868#[cfg_attr(feature = "serde", serde(tag = "type"))]
869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
870#[repr(u32)]
871#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
872pub enum FirmwareVersionType {
873 #[doc = "development release"]
874 FIRMWARE_VERSION_TYPE_DEV = 0,
875 #[doc = "alpha release"]
876 FIRMWARE_VERSION_TYPE_ALPHA = 64,
877 #[doc = "beta release"]
878 FIRMWARE_VERSION_TYPE_BETA = 128,
879 #[doc = "release candidate"]
880 FIRMWARE_VERSION_TYPE_RC = 192,
881 #[doc = "official stable release"]
882 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
883}
884impl FirmwareVersionType {
885 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
886}
887impl Default for FirmwareVersionType {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
893impl GimbalDeviceCapFlags {
894 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
895}
896impl Default for GimbalDeviceCapFlags {
897 fn default() -> Self {
898 Self::DEFAULT
899 }
900}
901bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
902impl GimbalDeviceErrorFlags {
903 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
904}
905impl Default for GimbalDeviceErrorFlags {
906 fn default() -> Self {
907 Self::DEFAULT
908 }
909}
910bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
911impl GimbalDeviceFlags {
912 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
913}
914impl Default for GimbalDeviceFlags {
915 fn default() -> Self {
916 Self::DEFAULT
917 }
918}
919bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
920impl GimbalManagerCapFlags {
921 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
922}
923impl Default for GimbalManagerCapFlags {
924 fn default() -> Self {
925 Self::DEFAULT
926 }
927}
928bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
929impl GimbalManagerFlags {
930 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
931}
932impl Default for GimbalManagerFlags {
933 fn default() -> Self {
934 Self::DEFAULT
935 }
936}
937#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
939#[cfg_attr(feature = "serde", serde(tag = "type"))]
940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
941#[repr(u32)]
942#[doc = "Type of GPS fix"]
943pub enum GpsFixType {
944 #[doc = "No GPS connected"]
945 GPS_FIX_TYPE_NO_GPS = 0,
946 #[doc = "No position information, GPS is connected"]
947 GPS_FIX_TYPE_NO_FIX = 1,
948 #[doc = "2D position"]
949 GPS_FIX_TYPE_2D_FIX = 2,
950 #[doc = "3D position"]
951 GPS_FIX_TYPE_3D_FIX = 3,
952 #[doc = "DGPS/SBAS aided 3D position"]
953 GPS_FIX_TYPE_DGPS = 4,
954 #[doc = "RTK float, 3D position"]
955 GPS_FIX_TYPE_RTK_FLOAT = 5,
956 #[doc = "RTK Fixed, 3D position"]
957 GPS_FIX_TYPE_RTK_FIXED = 6,
958 #[doc = "Static fixed, typically used for base stations"]
959 GPS_FIX_TYPE_STATIC = 7,
960 #[doc = "PPP, 3D position."]
961 GPS_FIX_TYPE_PPP = 8,
962}
963impl GpsFixType {
964 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
965}
966impl Default for GpsFixType {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
972impl GpsInputIgnoreFlags {
973 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
974}
975impl Default for GpsInputIgnoreFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
982#[cfg_attr(feature = "serde", serde(tag = "type"))]
983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
984#[repr(u32)]
985#[doc = "Gripper actions."]
986pub enum GripperActions {
987 #[doc = "Gripper release cargo."]
988 GRIPPER_ACTION_RELEASE = 0,
989 #[doc = "Gripper grab onto cargo."]
990 GRIPPER_ACTION_GRAB = 1,
991}
992impl GripperActions {
993 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
994}
995impl Default for GripperActions {
996 fn default() -> Self {
997 Self::DEFAULT
998 }
999}
1000bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1001impl HighresImuUpdatedFlags {
1002 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1003}
1004impl Default for HighresImuUpdatedFlags {
1005 fn default() -> Self {
1006 Self::DEFAULT
1007 }
1008}
1009bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1010impl HilActuatorControlsFlags {
1011 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1012}
1013impl Default for HilActuatorControlsFlags {
1014 fn default() -> Self {
1015 Self::DEFAULT
1016 }
1017}
1018bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1019impl HilSensorUpdatedFlags {
1020 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1021}
1022impl Default for HilSensorUpdatedFlags {
1023 fn default() -> Self {
1024 Self::DEFAULT
1025 }
1026}
1027bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1028impl HlFailureFlag {
1029 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1030}
1031impl Default for HlFailureFlag {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1037impl IlluminatorErrorFlags {
1038 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1039}
1040impl Default for IlluminatorErrorFlags {
1041 fn default() -> Self {
1042 Self::DEFAULT
1043 }
1044}
1045#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1047#[cfg_attr(feature = "serde", serde(tag = "type"))]
1048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1049#[repr(u32)]
1050#[doc = "Modes of illuminator"]
1051pub enum IlluminatorMode {
1052 #[doc = "Illuminator mode is not specified/unknown"]
1053 ILLUMINATOR_MODE_UNKNOWN = 0,
1054 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1055 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1056 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1057 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1058}
1059impl IlluminatorMode {
1060 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1061}
1062impl Default for IlluminatorMode {
1063 fn default() -> Self {
1064 Self::DEFAULT
1065 }
1066}
1067#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1069#[cfg_attr(feature = "serde", serde(tag = "type"))]
1070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1071#[repr(u32)]
1072#[doc = "Type of landing target"]
1073pub enum LandingTargetType {
1074 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1075 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1076 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1077 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1078 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1079 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1080 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1081 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1082}
1083impl LandingTargetType {
1084 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1085}
1086impl Default for LandingTargetType {
1087 fn default() -> Self {
1088 Self::DEFAULT
1089 }
1090}
1091#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1093#[cfg_attr(feature = "serde", serde(tag = "type"))]
1094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1095#[repr(u32)]
1096pub enum MagCalStatus {
1097 MAG_CAL_NOT_STARTED = 0,
1098 MAG_CAL_WAITING_TO_START = 1,
1099 MAG_CAL_RUNNING_STEP_ONE = 2,
1100 MAG_CAL_RUNNING_STEP_TWO = 3,
1101 MAG_CAL_SUCCESS = 4,
1102 MAG_CAL_FAILED = 5,
1103 MAG_CAL_BAD_ORIENTATION = 6,
1104 MAG_CAL_BAD_RADIUS = 7,
1105}
1106impl MagCalStatus {
1107 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1108}
1109impl Default for MagCalStatus {
1110 fn default() -> Self {
1111 Self::DEFAULT
1112 }
1113}
1114#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1116#[cfg_attr(feature = "serde", serde(tag = "type"))]
1117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1118#[repr(u32)]
1119pub enum MavArmAuthDeniedReason {
1120 #[doc = "Not a specific reason"]
1121 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1122 #[doc = "Authorizer will send the error as string to GCS"]
1123 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1124 #[doc = "At least one waypoint have a invalid value"]
1125 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1126 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1127 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1128 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1129 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1130 #[doc = "Weather is not good to fly"]
1131 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1132}
1133impl MavArmAuthDeniedReason {
1134 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1135}
1136impl Default for MavArmAuthDeniedReason {
1137 fn default() -> Self {
1138 Self::DEFAULT
1139 }
1140}
1141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1143#[cfg_attr(feature = "serde", serde(tag = "type"))]
1144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1145#[repr(u32)]
1146#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1147pub enum MavAutopilot {
1148 #[doc = "Generic autopilot, full support for everything"]
1149 MAV_AUTOPILOT_GENERIC = 0,
1150 #[doc = "Reserved for future use."]
1151 MAV_AUTOPILOT_RESERVED = 1,
1152 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1153 MAV_AUTOPILOT_SLUGS = 2,
1154 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1155 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1156 #[doc = "OpenPilot, <http://openpilot.org>"]
1157 MAV_AUTOPILOT_OPENPILOT = 4,
1158 #[doc = "Generic autopilot only supporting simple waypoints"]
1159 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1160 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1161 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1162 #[doc = "Generic autopilot supporting the full mission command set"]
1163 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1164 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1165 MAV_AUTOPILOT_INVALID = 8,
1166 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1167 MAV_AUTOPILOT_PPZ = 9,
1168 #[doc = "UAV Dev Board"]
1169 MAV_AUTOPILOT_UDB = 10,
1170 #[doc = "FlexiPilot"]
1171 MAV_AUTOPILOT_FP = 11,
1172 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1173 MAV_AUTOPILOT_PX4 = 12,
1174 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1175 MAV_AUTOPILOT_SMACCMPILOT = 13,
1176 #[doc = "AutoQuad -- <http://autoquad.org>"]
1177 MAV_AUTOPILOT_AUTOQUAD = 14,
1178 #[doc = "Armazila -- <http://armazila.com>"]
1179 MAV_AUTOPILOT_ARMAZILA = 15,
1180 #[doc = "Aerob -- <http://aerob.ru>"]
1181 MAV_AUTOPILOT_AEROB = 16,
1182 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1183 MAV_AUTOPILOT_ASLUAV = 17,
1184 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1185 MAV_AUTOPILOT_SMARTAP = 18,
1186 #[doc = "AirRails - <http://uaventure.com>"]
1187 MAV_AUTOPILOT_AIRRAILS = 19,
1188 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1189 MAV_AUTOPILOT_REFLEX = 20,
1190}
1191impl MavAutopilot {
1192 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1193}
1194impl Default for MavAutopilot {
1195 fn default() -> Self {
1196 Self::DEFAULT
1197 }
1198}
1199#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1201#[cfg_attr(feature = "serde", serde(tag = "type"))]
1202#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1203#[repr(u32)]
1204#[doc = "Enumeration for battery charge states."]
1205pub enum MavBatteryChargeState {
1206 #[doc = "Low battery state is not provided"]
1207 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1208 #[doc = "Battery is not in low state. Normal operation."]
1209 MAV_BATTERY_CHARGE_STATE_OK = 1,
1210 #[doc = "Battery state is low, warn and monitor close."]
1211 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1212 #[doc = "Battery state is critical, return or abort immediately."]
1213 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1214 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1215 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1216 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1217 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1218 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1219 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1220 #[doc = "Battery is charging."]
1221 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1222}
1223impl MavBatteryChargeState {
1224 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1225}
1226impl Default for MavBatteryChargeState {
1227 fn default() -> Self {
1228 Self::DEFAULT
1229 }
1230}
1231bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1232impl MavBatteryFault {
1233 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1234}
1235impl Default for MavBatteryFault {
1236 fn default() -> Self {
1237 Self::DEFAULT
1238 }
1239}
1240#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1242#[cfg_attr(feature = "serde", serde(tag = "type"))]
1243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1244#[repr(u32)]
1245#[doc = "Enumeration of battery functions"]
1246pub enum MavBatteryFunction {
1247 #[doc = "Battery function is unknown"]
1248 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1249 #[doc = "Battery supports all flight systems"]
1250 MAV_BATTERY_FUNCTION_ALL = 1,
1251 #[doc = "Battery for the propulsion system"]
1252 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1253 #[doc = "Avionics battery"]
1254 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1255 #[doc = "Payload battery"]
1256 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1257}
1258impl MavBatteryFunction {
1259 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1260}
1261impl Default for MavBatteryFunction {
1262 fn default() -> Self {
1263 Self::DEFAULT
1264 }
1265}
1266#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1268#[cfg_attr(feature = "serde", serde(tag = "type"))]
1269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1270#[repr(u32)]
1271#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1272pub enum MavBatteryMode {
1273 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1274 MAV_BATTERY_MODE_UNKNOWN = 0,
1275 #[doc = "Battery is auto discharging (towards storage level)."]
1276 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1277 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1278 MAV_BATTERY_MODE_HOT_SWAP = 2,
1279}
1280impl MavBatteryMode {
1281 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1282}
1283impl Default for MavBatteryMode {
1284 fn default() -> Self {
1285 Self::DEFAULT
1286 }
1287}
1288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1290#[cfg_attr(feature = "serde", serde(tag = "type"))]
1291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1292#[repr(u32)]
1293#[doc = "Enumeration of battery types"]
1294pub enum MavBatteryType {
1295 #[doc = "Not specified."]
1296 MAV_BATTERY_TYPE_UNKNOWN = 0,
1297 #[doc = "Lithium polymer battery"]
1298 MAV_BATTERY_TYPE_LIPO = 1,
1299 #[doc = "Lithium-iron-phosphate battery"]
1300 MAV_BATTERY_TYPE_LIFE = 2,
1301 #[doc = "Lithium-ION battery"]
1302 MAV_BATTERY_TYPE_LION = 3,
1303 #[doc = "Nickel metal hydride battery"]
1304 MAV_BATTERY_TYPE_NIMH = 4,
1305}
1306impl MavBatteryType {
1307 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1308}
1309impl Default for MavBatteryType {
1310 fn default() -> Self {
1311 Self::DEFAULT
1312 }
1313}
1314#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1316#[cfg_attr(feature = "serde", serde(tag = "type"))]
1317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1318#[repr(u32)]
1319#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1320pub enum MavCmd {
1321 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1322 MAV_CMD_NAV_WAYPOINT = 16,
1323 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1324 MAV_CMD_NAV_LOITER_UNLIM = 17,
1325 #[doc = "Loiter around this waypoint for X turns"]
1326 MAV_CMD_NAV_LOITER_TURNS = 18,
1327 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1328 MAV_CMD_NAV_LOITER_TIME = 19,
1329 #[doc = "Return to launch location"]
1330 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1331 #[doc = "Land at location."]
1332 MAV_CMD_NAV_LAND = 21,
1333 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1334 MAV_CMD_NAV_TAKEOFF = 22,
1335 #[doc = "Land at local position (local frame only)"]
1336 MAV_CMD_NAV_LAND_LOCAL = 23,
1337 #[doc = "Takeoff from local position (local frame only)"]
1338 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1339 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1340 MAV_CMD_NAV_FOLLOW = 25,
1341 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1342 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1343 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1344 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1345 #[doc = "Begin following a target"]
1346 MAV_CMD_DO_FOLLOW = 32,
1347 #[doc = "Reposition the MAV after a follow target command has been sent"]
1348 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1349 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1350 MAV_CMD_DO_ORBIT = 34,
1351 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1352 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1353 MAV_CMD_NAV_ROI = 80,
1354 #[doc = "Control autonomous path planning on the MAV."]
1355 MAV_CMD_NAV_PATHPLANNING = 81,
1356 #[doc = "Navigate to waypoint using a spline path."]
1357 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1358 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1359 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1360 #[doc = "Land using VTOL mode"]
1361 MAV_CMD_NAV_VTOL_LAND = 85,
1362 #[doc = "hand control over to an external controller"]
1363 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1364 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1365 MAV_CMD_NAV_DELAY = 93,
1366 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1367 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1368 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1369 MAV_CMD_NAV_LAST = 95,
1370 #[doc = "Delay mission state machine."]
1371 MAV_CMD_CONDITION_DELAY = 112,
1372 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1373 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1374 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1375 MAV_CMD_CONDITION_DISTANCE = 114,
1376 #[doc = "Reach a certain target angle."]
1377 MAV_CMD_CONDITION_YAW = 115,
1378 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1379 MAV_CMD_CONDITION_LAST = 159,
1380 #[doc = "Set system mode."]
1381 MAV_CMD_DO_SET_MODE = 176,
1382 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1383 MAV_CMD_DO_JUMP = 177,
1384 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1385 MAV_CMD_DO_CHANGE_SPEED = 178,
1386 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1387 MAV_CMD_DO_SET_HOME = 179,
1388 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1389 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1390 MAV_CMD_DO_SET_PARAMETER = 180,
1391 #[doc = "Set a relay to a condition."]
1392 MAV_CMD_DO_SET_RELAY = 181,
1393 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1394 MAV_CMD_DO_REPEAT_RELAY = 182,
1395 #[doc = "Set a servo to a desired PWM value."]
1396 MAV_CMD_DO_SET_SERVO = 183,
1397 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1398 MAV_CMD_DO_REPEAT_SERVO = 184,
1399 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1400 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1401 #[doc = "Change altitude set point."]
1402 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1403 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1404 MAV_CMD_DO_SET_ACTUATOR = 187,
1405 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1406 MAV_CMD_DO_RETURN_PATH_START = 188,
1407 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1408 MAV_CMD_DO_LAND_START = 189,
1409 #[doc = "Mission command to perform a landing from a rally point."]
1410 MAV_CMD_DO_RALLY_LAND = 190,
1411 #[doc = "Mission command to safely abort an autonomous landing."]
1412 MAV_CMD_DO_GO_AROUND = 191,
1413 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1414 MAV_CMD_DO_REPOSITION = 192,
1415 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1416 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1417 #[doc = "Set moving direction to forward or reverse."]
1418 MAV_CMD_DO_SET_REVERSE = 194,
1419 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1420 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1421 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1422 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1423 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1424 MAV_CMD_DO_SET_ROI_NONE = 197,
1425 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1426 MAV_CMD_DO_SET_ROI_SYSID = 198,
1427 #[doc = "Control onboard camera system."]
1428 MAV_CMD_DO_CONTROL_VIDEO = 200,
1429 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1430 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1431 MAV_CMD_DO_SET_ROI = 201,
1432 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1433 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1434 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1435 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1436 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1437 #[doc = "Mission command to configure a camera or antenna mount"]
1438 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1439 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1440 #[doc = "Mission command to control a camera or antenna mount"]
1441 MAV_CMD_DO_MOUNT_CONTROL = 205,
1442 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1443 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1444 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1445 MAV_CMD_DO_FENCE_ENABLE = 207,
1446 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1447 MAV_CMD_DO_PARACHUTE = 208,
1448 #[doc = "Command to perform motor test."]
1449 MAV_CMD_DO_MOTOR_TEST = 209,
1450 #[doc = "Change to/from inverted flight."]
1451 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1452 #[doc = "Mission command to operate a gripper."]
1453 MAV_CMD_DO_GRIPPER = 211,
1454 #[doc = "Enable/disable autotune."]
1455 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1456 #[doc = "Sets a desired vehicle turn angle and speed change."]
1457 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1458 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1459 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1460 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1461 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1462 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1463 #[doc = "set id of master controller"]
1464 MAV_CMD_DO_GUIDED_MASTER = 221,
1465 #[doc = "Set limits for external control"]
1466 MAV_CMD_DO_GUIDED_LIMITS = 222,
1467 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1468 MAV_CMD_DO_ENGINE_CONTROL = 223,
1469 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1470 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1471 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1472 MAV_CMD_DO_LAST = 240,
1473 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1474 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1475 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1476 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1477 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1478 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1479 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1480 MAV_CMD_PREFLIGHT_STORAGE = 245,
1481 #[doc = "Request the reboot or shutdown of system components."]
1482 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1483 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1484 MAV_CMD_OVERRIDE_GOTO = 252,
1485 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1486 MAV_CMD_OBLIQUE_SURVEY = 260,
1487 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1488 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1489 #[doc = "start running a mission"]
1490 MAV_CMD_MISSION_START = 300,
1491 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1492 MAV_CMD_ACTUATOR_TEST = 310,
1493 #[doc = "Actuator configuration command."]
1494 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1495 #[doc = "Arms / Disarms a component"]
1496 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1497 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1498 MAV_CMD_RUN_PREARM_CHECKS = 401,
1499 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1500 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1501 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1502 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1503 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1504 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1505 MAV_CMD_GET_HOME_POSITION = 410,
1506 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1507 MAV_CMD_INJECT_FAILURE = 420,
1508 #[doc = "Starts receiver pairing."]
1509 MAV_CMD_START_RX_PAIR = 500,
1510 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1511 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1512 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1513 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1514 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1515 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1516 MAV_CMD_REQUEST_MESSAGE = 512,
1517 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1518 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1519 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1520 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1521 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1522 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1523 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1524 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1525 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1526 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1527 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1528 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1529 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1530 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1531 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1532 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1533 MAV_CMD_STORAGE_FORMAT = 526,
1534 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1535 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1536 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1537 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1538 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1539 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1540 #[doc = "Reset all camera settings to Factory Default"]
1541 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1542 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1543 MAV_CMD_SET_CAMERA_MODE = 530,
1544 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1545 MAV_CMD_SET_CAMERA_ZOOM = 531,
1546 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1547 MAV_CMD_SET_CAMERA_FOCUS = 532,
1548 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1549 MAV_CMD_SET_STORAGE_USAGE = 533,
1550 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1551 MAV_CMD_SET_CAMERA_SOURCE = 534,
1552 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1553 MAV_CMD_JUMP_TAG = 600,
1554 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1555 MAV_CMD_DO_JUMP_TAG = 601,
1556 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1557 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1558 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1559 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1560 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1561 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1562 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1563 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1564 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1565 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1566 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1567 #[doc = "Enable or disable on-board camera triggering system."]
1568 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1569 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1570 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1571 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1572 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1573 #[doc = "Stops ongoing tracking."]
1574 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1575 #[doc = "Starts video capture (recording)."]
1576 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1577 #[doc = "Stop the current video capture (recording)."]
1578 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1579 #[doc = "Start video streaming"]
1580 MAV_CMD_VIDEO_START_STREAMING = 2502,
1581 #[doc = "Stop the given video stream"]
1582 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1583 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1584 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1585 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1587 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1588 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1589 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1590 MAV_CMD_LOGGING_START = 2510,
1591 #[doc = "Request to stop streaming log data over MAVLink"]
1592 MAV_CMD_LOGGING_STOP = 2511,
1593 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1594 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1595 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1596 #[doc = "Create a panorama at the current position"]
1597 MAV_CMD_PANORAMA_CREATE = 2800,
1598 #[doc = "Request VTOL transition"]
1599 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1600 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1601 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1602 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1603 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1604 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1605 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1606 #[doc = "Delay mission state machine until gate has been reached."]
1607 MAV_CMD_CONDITION_GATE = 4501,
1608 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1609 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1610 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1611 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1612 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1613 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1614 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1615 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1616 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1617 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1618 #[doc = "Rally point. You can have multiple rally points defined."]
1619 MAV_CMD_NAV_RALLY_POINT = 5100,
1620 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1621 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1622 #[doc = "Change state of safety switch."]
1623 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1624 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1625 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1626 #[deprecated = " (Deprecated since 2021-06)"]
1627 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1628 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1629 #[deprecated = " (Deprecated since 2021-06)"]
1630 #[doc = "Control the payload deployment."]
1631 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1632 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1633 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1634 #[doc = "Command to operate winch."]
1635 MAV_CMD_DO_WINCH = 42600,
1636 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1637 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1638 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1639 MAV_CMD_WAYPOINT_USER_1 = 31000,
1640 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1641 MAV_CMD_WAYPOINT_USER_2 = 31001,
1642 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1643 MAV_CMD_WAYPOINT_USER_3 = 31002,
1644 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1645 MAV_CMD_WAYPOINT_USER_4 = 31003,
1646 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1647 MAV_CMD_WAYPOINT_USER_5 = 31004,
1648 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1649 MAV_CMD_SPATIAL_USER_1 = 31005,
1650 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1651 MAV_CMD_SPATIAL_USER_2 = 31006,
1652 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1653 MAV_CMD_SPATIAL_USER_3 = 31007,
1654 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1655 MAV_CMD_SPATIAL_USER_4 = 31008,
1656 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1657 MAV_CMD_SPATIAL_USER_5 = 31009,
1658 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1659 MAV_CMD_USER_1 = 31010,
1660 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1661 MAV_CMD_USER_2 = 31011,
1662 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1663 MAV_CMD_USER_3 = 31012,
1664 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1665 MAV_CMD_USER_4 = 31013,
1666 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1667 MAV_CMD_USER_5 = 31014,
1668 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1669 MAV_CMD_CAN_FORWARD = 32000,
1670}
1671impl MavCmd {
1672 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1673}
1674impl Default for MavCmd {
1675 fn default() -> Self {
1676 Self::DEFAULT
1677 }
1678}
1679#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1681#[cfg_attr(feature = "serde", serde(tag = "type"))]
1682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1683#[repr(u32)]
1684#[doc = "Possible actions an aircraft can take to avoid a collision."]
1685pub enum MavCollisionAction {
1686 #[doc = "Ignore any potential collisions"]
1687 MAV_COLLISION_ACTION_NONE = 0,
1688 #[doc = "Report potential collision"]
1689 MAV_COLLISION_ACTION_REPORT = 1,
1690 #[doc = "Ascend or Descend to avoid threat"]
1691 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1692 #[doc = "Move horizontally to avoid threat"]
1693 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1694 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1695 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1696 #[doc = "Aircraft to fly directly back to its launch point"]
1697 MAV_COLLISION_ACTION_RTL = 5,
1698 #[doc = "Aircraft to stop in place"]
1699 MAV_COLLISION_ACTION_HOVER = 6,
1700}
1701impl MavCollisionAction {
1702 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1703}
1704impl Default for MavCollisionAction {
1705 fn default() -> Self {
1706 Self::DEFAULT
1707 }
1708}
1709#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1711#[cfg_attr(feature = "serde", serde(tag = "type"))]
1712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1713#[repr(u32)]
1714#[doc = "Source of information about this collision."]
1715pub enum MavCollisionSrc {
1716 #[doc = "ID field references ADSB_VEHICLE packets"]
1717 MAV_COLLISION_SRC_ADSB = 0,
1718 #[doc = "ID field references MAVLink SRC ID"]
1719 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1720}
1721impl MavCollisionSrc {
1722 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1723}
1724impl Default for MavCollisionSrc {
1725 fn default() -> Self {
1726 Self::DEFAULT
1727 }
1728}
1729#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1731#[cfg_attr(feature = "serde", serde(tag = "type"))]
1732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1733#[repr(u32)]
1734#[doc = "Aircraft-rated danger from this threat."]
1735pub enum MavCollisionThreatLevel {
1736 #[doc = "Not a threat"]
1737 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1738 #[doc = "Craft is mildly concerned about this threat"]
1739 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1740 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1741 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1742}
1743impl MavCollisionThreatLevel {
1744 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1745}
1746impl Default for MavCollisionThreatLevel {
1747 fn default() -> Self {
1748 Self::DEFAULT
1749 }
1750}
1751#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1753#[cfg_attr(feature = "serde", serde(tag = "type"))]
1754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1755#[repr(u32)]
1756#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1757pub enum MavComponent {
1758 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1759 MAV_COMP_ID_ALL = 0,
1760 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1761 MAV_COMP_ID_AUTOPILOT1 = 1,
1762 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1763 MAV_COMP_ID_USER1 = 25,
1764 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1765 MAV_COMP_ID_USER2 = 26,
1766 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1767 MAV_COMP_ID_USER3 = 27,
1768 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1769 MAV_COMP_ID_USER4 = 28,
1770 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1771 MAV_COMP_ID_USER5 = 29,
1772 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1773 MAV_COMP_ID_USER6 = 30,
1774 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1775 MAV_COMP_ID_USER7 = 31,
1776 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1777 MAV_COMP_ID_USER8 = 32,
1778 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1779 MAV_COMP_ID_USER9 = 33,
1780 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1781 MAV_COMP_ID_USER10 = 34,
1782 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1783 MAV_COMP_ID_USER11 = 35,
1784 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1785 MAV_COMP_ID_USER12 = 36,
1786 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1787 MAV_COMP_ID_USER13 = 37,
1788 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1789 MAV_COMP_ID_USER14 = 38,
1790 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1791 MAV_COMP_ID_USER15 = 39,
1792 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1793 MAV_COMP_ID_USER16 = 40,
1794 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1795 MAV_COMP_ID_USER17 = 41,
1796 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1797 MAV_COMP_ID_USER18 = 42,
1798 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1799 MAV_COMP_ID_USER19 = 43,
1800 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1801 MAV_COMP_ID_USER20 = 44,
1802 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1803 MAV_COMP_ID_USER21 = 45,
1804 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1805 MAV_COMP_ID_USER22 = 46,
1806 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1807 MAV_COMP_ID_USER23 = 47,
1808 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1809 MAV_COMP_ID_USER24 = 48,
1810 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1811 MAV_COMP_ID_USER25 = 49,
1812 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1813 MAV_COMP_ID_USER26 = 50,
1814 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1815 MAV_COMP_ID_USER27 = 51,
1816 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1817 MAV_COMP_ID_USER28 = 52,
1818 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1819 MAV_COMP_ID_USER29 = 53,
1820 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1821 MAV_COMP_ID_USER30 = 54,
1822 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1823 MAV_COMP_ID_USER31 = 55,
1824 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1825 MAV_COMP_ID_USER32 = 56,
1826 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1827 MAV_COMP_ID_USER33 = 57,
1828 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1829 MAV_COMP_ID_USER34 = 58,
1830 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1831 MAV_COMP_ID_USER35 = 59,
1832 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1833 MAV_COMP_ID_USER36 = 60,
1834 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1835 MAV_COMP_ID_USER37 = 61,
1836 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1837 MAV_COMP_ID_USER38 = 62,
1838 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1839 MAV_COMP_ID_USER39 = 63,
1840 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1841 MAV_COMP_ID_USER40 = 64,
1842 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1843 MAV_COMP_ID_USER41 = 65,
1844 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1845 MAV_COMP_ID_USER42 = 66,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER43 = 67,
1848 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1849 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER45 = 69,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER46 = 70,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER47 = 71,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER48 = 72,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER49 = 73,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER50 = 74,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER51 = 75,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER52 = 76,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER53 = 77,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER54 = 78,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER55 = 79,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER56 = 80,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER57 = 81,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER58 = 82,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER59 = 83,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER60 = 84,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER61 = 85,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER62 = 86,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER63 = 87,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER64 = 88,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER65 = 89,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER66 = 90,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER67 = 91,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER68 = 92,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER69 = 93,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER70 = 94,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER71 = 95,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER72 = 96,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER73 = 97,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER74 = 98,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER75 = 99,
1912 #[doc = "Camera #1."]
1913 MAV_COMP_ID_CAMERA = 100,
1914 #[doc = "Camera #2."]
1915 MAV_COMP_ID_CAMERA2 = 101,
1916 #[doc = "Camera #3."]
1917 MAV_COMP_ID_CAMERA3 = 102,
1918 #[doc = "Camera #4."]
1919 MAV_COMP_ID_CAMERA4 = 103,
1920 #[doc = "Camera #5."]
1921 MAV_COMP_ID_CAMERA5 = 104,
1922 #[doc = "Camera #6."]
1923 MAV_COMP_ID_CAMERA6 = 105,
1924 #[doc = "Servo #1."]
1925 MAV_COMP_ID_SERVO1 = 140,
1926 #[doc = "Servo #2."]
1927 MAV_COMP_ID_SERVO2 = 141,
1928 #[doc = "Servo #3."]
1929 MAV_COMP_ID_SERVO3 = 142,
1930 #[doc = "Servo #4."]
1931 MAV_COMP_ID_SERVO4 = 143,
1932 #[doc = "Servo #5."]
1933 MAV_COMP_ID_SERVO5 = 144,
1934 #[doc = "Servo #6."]
1935 MAV_COMP_ID_SERVO6 = 145,
1936 #[doc = "Servo #7."]
1937 MAV_COMP_ID_SERVO7 = 146,
1938 #[doc = "Servo #8."]
1939 MAV_COMP_ID_SERVO8 = 147,
1940 #[doc = "Servo #9."]
1941 MAV_COMP_ID_SERVO9 = 148,
1942 #[doc = "Servo #10."]
1943 MAV_COMP_ID_SERVO10 = 149,
1944 #[doc = "Servo #11."]
1945 MAV_COMP_ID_SERVO11 = 150,
1946 #[doc = "Servo #12."]
1947 MAV_COMP_ID_SERVO12 = 151,
1948 #[doc = "Servo #13."]
1949 MAV_COMP_ID_SERVO13 = 152,
1950 #[doc = "Servo #14."]
1951 MAV_COMP_ID_SERVO14 = 153,
1952 #[doc = "Gimbal #1."]
1953 MAV_COMP_ID_GIMBAL = 154,
1954 #[doc = "Logging component."]
1955 MAV_COMP_ID_LOG = 155,
1956 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
1957 MAV_COMP_ID_ADSB = 156,
1958 #[doc = "On Screen Display (OSD) devices for video links."]
1959 MAV_COMP_ID_OSD = 157,
1960 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
1961 MAV_COMP_ID_PERIPHERAL = 158,
1962 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
1963 #[doc = "Gimbal ID for QX1."]
1964 MAV_COMP_ID_QX1_GIMBAL = 159,
1965 #[doc = "FLARM collision alert component."]
1966 MAV_COMP_ID_FLARM = 160,
1967 #[doc = "Parachute component."]
1968 MAV_COMP_ID_PARACHUTE = 161,
1969 #[doc = "Winch component."]
1970 MAV_COMP_ID_WINCH = 169,
1971 #[doc = "Gimbal #2."]
1972 MAV_COMP_ID_GIMBAL2 = 171,
1973 #[doc = "Gimbal #3."]
1974 MAV_COMP_ID_GIMBAL3 = 172,
1975 #[doc = "Gimbal #4"]
1976 MAV_COMP_ID_GIMBAL4 = 173,
1977 #[doc = "Gimbal #5."]
1978 MAV_COMP_ID_GIMBAL5 = 174,
1979 #[doc = "Gimbal #6."]
1980 MAV_COMP_ID_GIMBAL6 = 175,
1981 #[doc = "Battery #1."]
1982 MAV_COMP_ID_BATTERY = 180,
1983 #[doc = "Battery #2."]
1984 MAV_COMP_ID_BATTERY2 = 181,
1985 #[doc = "CAN over MAVLink client."]
1986 MAV_COMP_ID_MAVCAN = 189,
1987 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
1988 MAV_COMP_ID_MISSIONPLANNER = 190,
1989 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1990 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
1991 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1992 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
1993 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1994 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
1995 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1996 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
1997 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
1998 MAV_COMP_ID_PATHPLANNER = 195,
1999 #[doc = "Component that plans a collision free path between two points."]
2000 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2001 #[doc = "Component that provides position estimates using VIO techniques."]
2002 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2003 #[doc = "Component that manages pairing of vehicle and GCS."]
2004 MAV_COMP_ID_PAIRING_MANAGER = 198,
2005 #[doc = "Inertial Measurement Unit (IMU) #1."]
2006 MAV_COMP_ID_IMU = 200,
2007 #[doc = "Inertial Measurement Unit (IMU) #2."]
2008 MAV_COMP_ID_IMU_2 = 201,
2009 #[doc = "Inertial Measurement Unit (IMU) #3."]
2010 MAV_COMP_ID_IMU_3 = 202,
2011 #[doc = "GPS #1."]
2012 MAV_COMP_ID_GPS = 220,
2013 #[doc = "GPS #2."]
2014 MAV_COMP_ID_GPS2 = 221,
2015 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2016 MAV_COMP_ID_ODID_TXRX_1 = 236,
2017 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2018 MAV_COMP_ID_ODID_TXRX_2 = 237,
2019 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2020 MAV_COMP_ID_ODID_TXRX_3 = 238,
2021 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2022 MAV_COMP_ID_UDP_BRIDGE = 240,
2023 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2024 MAV_COMP_ID_UART_BRIDGE = 241,
2025 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2026 MAV_COMP_ID_TUNNEL_NODE = 242,
2027 #[doc = "Illuminator"]
2028 MAV_COMP_ID_ILLUMINATOR = 243,
2029 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2030 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2031 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2032}
2033impl MavComponent {
2034 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2035}
2036impl Default for MavComponent {
2037 fn default() -> Self {
2038 Self::DEFAULT
2039 }
2040}
2041#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2043#[cfg_attr(feature = "serde", serde(tag = "type"))]
2044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2045#[repr(u32)]
2046#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2047#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2048pub enum MavDataStream {
2049 #[doc = "Enable all data streams"]
2050 MAV_DATA_STREAM_ALL = 0,
2051 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2052 MAV_DATA_STREAM_RAW_SENSORS = 1,
2053 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2054 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2055 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2056 MAV_DATA_STREAM_RC_CHANNELS = 3,
2057 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2058 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2059 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2060 MAV_DATA_STREAM_POSITION = 6,
2061 #[doc = "Dependent on the autopilot"]
2062 MAV_DATA_STREAM_EXTRA1 = 10,
2063 #[doc = "Dependent on the autopilot"]
2064 MAV_DATA_STREAM_EXTRA2 = 11,
2065 #[doc = "Dependent on the autopilot"]
2066 MAV_DATA_STREAM_EXTRA3 = 12,
2067}
2068impl MavDataStream {
2069 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2070}
2071impl Default for MavDataStream {
2072 fn default() -> Self {
2073 Self::DEFAULT
2074 }
2075}
2076#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2078#[cfg_attr(feature = "serde", serde(tag = "type"))]
2079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2080#[repr(u32)]
2081#[doc = "Enumeration of distance sensor types"]
2082pub enum MavDistanceSensor {
2083 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2084 MAV_DISTANCE_SENSOR_LASER = 0,
2085 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2086 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2087 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2088 MAV_DISTANCE_SENSOR_INFRARED = 2,
2089 #[doc = "Radar type, e.g. uLanding units"]
2090 MAV_DISTANCE_SENSOR_RADAR = 3,
2091 #[doc = "Broken or unknown type, e.g. analog units"]
2092 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2093}
2094impl MavDistanceSensor {
2095 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2096}
2097impl Default for MavDistanceSensor {
2098 fn default() -> Self {
2099 Self::DEFAULT
2100 }
2101}
2102#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2103#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2104#[cfg_attr(feature = "serde", serde(tag = "type"))]
2105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2106#[repr(u32)]
2107#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2108pub enum MavDoRepositionFlags {
2109 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2110 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2111}
2112impl MavDoRepositionFlags {
2113 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2114}
2115impl Default for MavDoRepositionFlags {
2116 fn default() -> Self {
2117 Self::DEFAULT
2118 }
2119}
2120#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2121#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2122#[cfg_attr(feature = "serde", serde(tag = "type"))]
2123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2124#[repr(u32)]
2125#[doc = "Enumeration of estimator types"]
2126pub enum MavEstimatorType {
2127 #[doc = "Unknown type of the estimator."]
2128 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2129 #[doc = "This is a naive estimator without any real covariance feedback."]
2130 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2131 #[doc = "Computer vision based estimate. Might be up to scale."]
2132 MAV_ESTIMATOR_TYPE_VISION = 2,
2133 #[doc = "Visual-inertial estimate."]
2134 MAV_ESTIMATOR_TYPE_VIO = 3,
2135 #[doc = "Plain GPS estimate."]
2136 MAV_ESTIMATOR_TYPE_GPS = 4,
2137 #[doc = "Estimator integrating GPS and inertial sensing."]
2138 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2139 #[doc = "Estimate from external motion capturing system."]
2140 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2141 #[doc = "Estimator based on lidar sensor input."]
2142 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2143 #[doc = "Estimator on autopilot."]
2144 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2145}
2146impl MavEstimatorType {
2147 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2148}
2149impl Default for MavEstimatorType {
2150 fn default() -> Self {
2151 Self::DEFAULT
2152 }
2153}
2154#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2156#[cfg_attr(feature = "serde", serde(tag = "type"))]
2157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2158#[repr(u32)]
2159#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2160pub enum MavEventCurrentSequenceFlags {
2161 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2162 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2163}
2164impl MavEventCurrentSequenceFlags {
2165 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2166}
2167impl Default for MavEventCurrentSequenceFlags {
2168 fn default() -> Self {
2169 Self::DEFAULT
2170 }
2171}
2172#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2173#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2174#[cfg_attr(feature = "serde", serde(tag = "type"))]
2175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2176#[repr(u32)]
2177#[doc = "Reason for an event error response."]
2178pub enum MavEventErrorReason {
2179 #[doc = "The requested event is not available (anymore)."]
2180 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2181}
2182impl MavEventErrorReason {
2183 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2184}
2185impl Default for MavEventErrorReason {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2192#[cfg_attr(feature = "serde", serde(tag = "type"))]
2193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2194#[repr(u32)]
2195#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2196pub enum MavFrame {
2197 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2198 MAV_FRAME_GLOBAL = 0,
2199 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2200 MAV_FRAME_LOCAL_NED = 1,
2201 #[doc = "NOT a coordinate frame, indicates a mission command."]
2202 MAV_FRAME_MISSION = 2,
2203 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2204 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2205 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2206 MAV_FRAME_LOCAL_ENU = 4,
2207 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2208 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2209 MAV_FRAME_GLOBAL_INT = 5,
2210 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2211 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2212 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2213 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2214 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2215 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2216 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2217 MAV_FRAME_BODY_NED = 8,
2218 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2219 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2220 MAV_FRAME_BODY_OFFSET_NED = 9,
2221 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2222 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2223 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2224 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2225 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2226 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2227 MAV_FRAME_BODY_FRD = 12,
2228 #[deprecated = " (Deprecated since 2019-04)"]
2229 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2230 MAV_FRAME_RESERVED_13 = 13,
2231 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2232 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2233 MAV_FRAME_RESERVED_14 = 14,
2234 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2235 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2236 MAV_FRAME_RESERVED_15 = 15,
2237 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2238 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2239 MAV_FRAME_RESERVED_16 = 16,
2240 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2241 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2242 MAV_FRAME_RESERVED_17 = 17,
2243 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2244 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2245 MAV_FRAME_RESERVED_18 = 18,
2246 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2247 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2248 MAV_FRAME_RESERVED_19 = 19,
2249 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2250 MAV_FRAME_LOCAL_FRD = 20,
2251 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2252 MAV_FRAME_LOCAL_FLU = 21,
2253}
2254impl MavFrame {
2255 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2256}
2257impl Default for MavFrame {
2258 fn default() -> Self {
2259 Self::DEFAULT
2260 }
2261}
2262#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2264#[cfg_attr(feature = "serde", serde(tag = "type"))]
2265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2266#[repr(u32)]
2267#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2268pub enum MavFtpErr {
2269 #[doc = "None: No error"]
2270 MAV_FTP_ERR_NONE = 0,
2271 #[doc = "Fail: Unknown failure"]
2272 MAV_FTP_ERR_FAIL = 1,
2273 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2274 MAV_FTP_ERR_FAILERRNO = 2,
2275 #[doc = "InvalidDataSize: Payload size is invalid"]
2276 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2277 #[doc = "InvalidSession: Session is not currently open"]
2278 MAV_FTP_ERR_INVALIDSESSION = 4,
2279 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2280 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2281 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2282 MAV_FTP_ERR_EOF = 6,
2283 #[doc = "UnknownCommand: Unknown command / opcode"]
2284 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2285 #[doc = "FileExists: File/directory already exists"]
2286 MAV_FTP_ERR_FILEEXISTS = 8,
2287 #[doc = "FileProtected: File/directory is write protected"]
2288 MAV_FTP_ERR_FILEPROTECTED = 9,
2289 #[doc = "FileNotFound: File/directory not found"]
2290 MAV_FTP_ERR_FILENOTFOUND = 10,
2291}
2292impl MavFtpErr {
2293 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2294}
2295impl Default for MavFtpErr {
2296 fn default() -> Self {
2297 Self::DEFAULT
2298 }
2299}
2300#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2302#[cfg_attr(feature = "serde", serde(tag = "type"))]
2303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2304#[repr(u32)]
2305#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2306pub enum MavFtpOpcode {
2307 #[doc = "None. Ignored, always ACKed"]
2308 MAV_FTP_OPCODE_NONE = 0,
2309 #[doc = "TerminateSession: Terminates open Read session"]
2310 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2311 #[doc = "ResetSessions: Terminates all open read sessions"]
2312 MAV_FTP_OPCODE_RESETSESSION = 2,
2313 #[doc = "ListDirectory. List files and directories in path from offset"]
2314 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2315 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2316 MAV_FTP_OPCODE_OPENFILERO = 4,
2317 #[doc = "ReadFile: Reads size bytes from offset in session"]
2318 MAV_FTP_OPCODE_READFILE = 5,
2319 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2320 MAV_FTP_OPCODE_CREATEFILE = 6,
2321 #[doc = "WriteFile: Writes size bytes to offset in session"]
2322 MAV_FTP_OPCODE_WRITEFILE = 7,
2323 #[doc = "RemoveFile: Remove file at path"]
2324 MAV_FTP_OPCODE_REMOVEFILE = 8,
2325 #[doc = "CreateDirectory: Creates directory at path"]
2326 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2327 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2328 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2329 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2330 MAV_FTP_OPCODE_OPENFILEWO = 11,
2331 #[doc = "TruncateFile: Truncate file at path to offset length"]
2332 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2333 #[doc = "Rename: Rename path1 to path2"]
2334 MAV_FTP_OPCODE_RENAME = 13,
2335 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2336 MAV_FTP_OPCODE_CALCFILECRC = 14,
2337 #[doc = "BurstReadFile: Burst download session file"]
2338 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2339 #[doc = "ACK: ACK response"]
2340 MAV_FTP_OPCODE_ACK = 128,
2341 #[doc = "NAK: NAK response"]
2342 MAV_FTP_OPCODE_NAK = 129,
2343}
2344impl MavFtpOpcode {
2345 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2346}
2347impl Default for MavFtpOpcode {
2348 fn default() -> Self {
2349 Self::DEFAULT
2350 }
2351}
2352#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2354#[cfg_attr(feature = "serde", serde(tag = "type"))]
2355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2356#[repr(u32)]
2357#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2358pub enum MavFuelType {
2359 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2360 MAV_FUEL_TYPE_UNKNOWN = 0,
2361 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2362 MAV_FUEL_TYPE_LIQUID = 1,
2363 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2364 MAV_FUEL_TYPE_GAS = 2,
2365}
2366impl MavFuelType {
2367 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2368}
2369impl Default for MavFuelType {
2370 fn default() -> Self {
2371 Self::DEFAULT
2372 }
2373}
2374bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2375impl MavGeneratorStatusFlag {
2376 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2377}
2378impl Default for MavGeneratorStatusFlag {
2379 fn default() -> Self {
2380 Self::DEFAULT
2381 }
2382}
2383#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2385#[cfg_attr(feature = "serde", serde(tag = "type"))]
2386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2387#[repr(u32)]
2388#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2389pub enum MavGoto {
2390 #[doc = "Hold at the current position."]
2391 MAV_GOTO_DO_HOLD = 0,
2392 #[doc = "Continue with the next item in mission execution."]
2393 MAV_GOTO_DO_CONTINUE = 1,
2394 #[doc = "Hold at the current position of the system"]
2395 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2396 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2397 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2398}
2399impl MavGoto {
2400 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2401}
2402impl Default for MavGoto {
2403 fn default() -> Self {
2404 Self::DEFAULT
2405 }
2406}
2407#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2409#[cfg_attr(feature = "serde", serde(tag = "type"))]
2410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2411#[repr(u32)]
2412#[doc = "Enumeration of landed detector states"]
2413pub enum MavLandedState {
2414 #[doc = "MAV landed state is unknown"]
2415 MAV_LANDED_STATE_UNDEFINED = 0,
2416 #[doc = "MAV is landed (on ground)"]
2417 MAV_LANDED_STATE_ON_GROUND = 1,
2418 #[doc = "MAV is in air"]
2419 MAV_LANDED_STATE_IN_AIR = 2,
2420 #[doc = "MAV currently taking off"]
2421 MAV_LANDED_STATE_TAKEOFF = 3,
2422 #[doc = "MAV currently landing"]
2423 MAV_LANDED_STATE_LANDING = 4,
2424}
2425impl MavLandedState {
2426 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2427}
2428impl Default for MavLandedState {
2429 fn default() -> Self {
2430 Self::DEFAULT
2431 }
2432}
2433#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2435#[cfg_attr(feature = "serde", serde(tag = "type"))]
2436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2437#[repr(u32)]
2438#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2439pub enum MavMissionResult {
2440 #[doc = "mission accepted OK"]
2441 MAV_MISSION_ACCEPTED = 0,
2442 #[doc = "Generic error / not accepting mission commands at all right now."]
2443 MAV_MISSION_ERROR = 1,
2444 #[doc = "Coordinate frame is not supported."]
2445 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2446 #[doc = "Command is not supported."]
2447 MAV_MISSION_UNSUPPORTED = 3,
2448 #[doc = "Mission items exceed storage space."]
2449 MAV_MISSION_NO_SPACE = 4,
2450 #[doc = "One of the parameters has an invalid value."]
2451 MAV_MISSION_INVALID = 5,
2452 #[doc = "param1 has an invalid value."]
2453 MAV_MISSION_INVALID_PARAM1 = 6,
2454 #[doc = "param2 has an invalid value."]
2455 MAV_MISSION_INVALID_PARAM2 = 7,
2456 #[doc = "param3 has an invalid value."]
2457 MAV_MISSION_INVALID_PARAM3 = 8,
2458 #[doc = "param4 has an invalid value."]
2459 MAV_MISSION_INVALID_PARAM4 = 9,
2460 #[doc = "x / param5 has an invalid value."]
2461 MAV_MISSION_INVALID_PARAM5_X = 10,
2462 #[doc = "y / param6 has an invalid value."]
2463 MAV_MISSION_INVALID_PARAM6_Y = 11,
2464 #[doc = "z / param7 has an invalid value."]
2465 MAV_MISSION_INVALID_PARAM7 = 12,
2466 #[doc = "Mission item received out of sequence"]
2467 MAV_MISSION_INVALID_SEQUENCE = 13,
2468 #[doc = "Not accepting any mission commands from this communication partner."]
2469 MAV_MISSION_DENIED = 14,
2470 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2471 MAV_MISSION_OPERATION_CANCELLED = 15,
2472}
2473impl MavMissionResult {
2474 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2475}
2476impl Default for MavMissionResult {
2477 fn default() -> Self {
2478 Self::DEFAULT
2479 }
2480}
2481#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2483#[cfg_attr(feature = "serde", serde(tag = "type"))]
2484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2485#[repr(u32)]
2486#[doc = "Type of mission items being requested/sent in mission protocol."]
2487pub enum MavMissionType {
2488 #[doc = "Items are mission commands for main mission."]
2489 MAV_MISSION_TYPE_MISSION = 0,
2490 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2491 MAV_MISSION_TYPE_FENCE = 1,
2492 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2493 MAV_MISSION_TYPE_RALLY = 2,
2494 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2495 MAV_MISSION_TYPE_ALL = 255,
2496}
2497impl MavMissionType {
2498 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2499}
2500impl Default for MavMissionType {
2501 fn default() -> Self {
2502 Self::DEFAULT
2503 }
2504}
2505#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2507#[cfg_attr(feature = "serde", serde(tag = "type"))]
2508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2509#[repr(u32)]
2510#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2511pub enum MavMode {
2512 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2513 MAV_MODE_PREFLIGHT = 0,
2514 #[doc = "System is allowed to be active, under assisted RC control."]
2515 MAV_MODE_STABILIZE_DISARMED = 80,
2516 #[doc = "System is allowed to be active, under assisted RC control."]
2517 MAV_MODE_STABILIZE_ARMED = 208,
2518 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2519 MAV_MODE_MANUAL_DISARMED = 64,
2520 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2521 MAV_MODE_MANUAL_ARMED = 192,
2522 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2523 MAV_MODE_GUIDED_DISARMED = 88,
2524 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2525 MAV_MODE_GUIDED_ARMED = 216,
2526 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2527 MAV_MODE_AUTO_DISARMED = 92,
2528 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2529 MAV_MODE_AUTO_ARMED = 220,
2530 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2531 MAV_MODE_TEST_DISARMED = 66,
2532 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2533 MAV_MODE_TEST_ARMED = 194,
2534}
2535impl MavMode {
2536 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2537}
2538impl Default for MavMode {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2544impl MavModeFlag {
2545 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2546}
2547impl Default for MavModeFlag {
2548 fn default() -> Self {
2549 Self::DEFAULT
2550 }
2551}
2552#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2554#[cfg_attr(feature = "serde", serde(tag = "type"))]
2555#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2556#[repr(u32)]
2557#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2558pub enum MavModeFlagDecodePosition {
2559 #[doc = "First bit: 10000000"]
2560 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2561 #[doc = "Second bit: 01000000"]
2562 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2563 #[doc = "Third bit: 00100000"]
2564 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2565 #[doc = "Fourth bit: 00010000"]
2566 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2567 #[doc = "Fifth bit: 00001000"]
2568 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2569 #[doc = "Sixth bit: 00000100"]
2570 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2571 #[doc = "Seventh bit: 00000010"]
2572 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2573 #[doc = "Eighth bit: 00000001"]
2574 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2575}
2576impl MavModeFlagDecodePosition {
2577 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2578}
2579impl Default for MavModeFlagDecodePosition {
2580 fn default() -> Self {
2581 Self::DEFAULT
2582 }
2583}
2584bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2585impl MavModeProperty {
2586 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2587}
2588impl Default for MavModeProperty {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2595#[cfg_attr(feature = "serde", serde(tag = "type"))]
2596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2597#[repr(u32)]
2598#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2599#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2600pub enum MavMountMode {
2601 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2602 MAV_MOUNT_MODE_RETRACT = 0,
2603 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2604 MAV_MOUNT_MODE_NEUTRAL = 1,
2605 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2606 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2607 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2608 MAV_MOUNT_MODE_RC_TARGETING = 3,
2609 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2610 MAV_MOUNT_MODE_GPS_POINT = 4,
2611 #[doc = "Gimbal tracks system with specified system ID"]
2612 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2613 #[doc = "Gimbal tracks home position"]
2614 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2615}
2616impl MavMountMode {
2617 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2618}
2619impl Default for MavMountMode {
2620 fn default() -> Self {
2621 Self::DEFAULT
2622 }
2623}
2624#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2626#[cfg_attr(feature = "serde", serde(tag = "type"))]
2627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2628#[repr(u32)]
2629pub enum MavOdidArmStatus {
2630 #[doc = "Passing arming checks."]
2631 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2632 #[doc = "Generic arming failure, see error string for details."]
2633 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2634}
2635impl MavOdidArmStatus {
2636 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2637}
2638impl Default for MavOdidArmStatus {
2639 fn default() -> Self {
2640 Self::DEFAULT
2641 }
2642}
2643#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2644#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2645#[cfg_attr(feature = "serde", serde(tag = "type"))]
2646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2647#[repr(u32)]
2648pub enum MavOdidAuthType {
2649 #[doc = "No authentication type is specified."]
2650 MAV_ODID_AUTH_TYPE_NONE = 0,
2651 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2652 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2653 #[doc = "Signature for the Operator ID."]
2654 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2655 #[doc = "Signature for the entire message set."]
2656 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2657 #[doc = "Authentication is provided by Network Remote ID."]
2658 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2659 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2660 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2661}
2662impl MavOdidAuthType {
2663 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2664}
2665impl Default for MavOdidAuthType {
2666 fn default() -> Self {
2667 Self::DEFAULT
2668 }
2669}
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675pub enum MavOdidCategoryEu {
2676 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2677 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2678 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2679 MAV_ODID_CATEGORY_EU_OPEN = 1,
2680 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2681 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2682 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2683 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2684}
2685impl MavOdidCategoryEu {
2686 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2687}
2688impl Default for MavOdidCategoryEu {
2689 fn default() -> Self {
2690 Self::DEFAULT
2691 }
2692}
2693#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2695#[cfg_attr(feature = "serde", serde(tag = "type"))]
2696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2697#[repr(u32)]
2698pub enum MavOdidClassEu {
2699 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2700 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2701 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2702 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2703 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2704 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2705 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2706 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2707 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2708 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2709 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2710 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2711 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2712 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2713 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2714 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2715}
2716impl MavOdidClassEu {
2717 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2718}
2719impl Default for MavOdidClassEu {
2720 fn default() -> Self {
2721 Self::DEFAULT
2722 }
2723}
2724#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2725#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2726#[cfg_attr(feature = "serde", serde(tag = "type"))]
2727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2728#[repr(u32)]
2729pub enum MavOdidClassificationType {
2730 #[doc = "The classification type for the UA is undeclared."]
2731 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2732 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2733 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2734}
2735impl MavOdidClassificationType {
2736 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2737}
2738impl Default for MavOdidClassificationType {
2739 fn default() -> Self {
2740 Self::DEFAULT
2741 }
2742}
2743#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2745#[cfg_attr(feature = "serde", serde(tag = "type"))]
2746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2747#[repr(u32)]
2748pub enum MavOdidDescType {
2749 #[doc = "Optional free-form text description of the purpose of the flight."]
2750 MAV_ODID_DESC_TYPE_TEXT = 0,
2751 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2752 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2753 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2754 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2755}
2756impl MavOdidDescType {
2757 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2758}
2759impl Default for MavOdidDescType {
2760 fn default() -> Self {
2761 Self::DEFAULT
2762 }
2763}
2764#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2766#[cfg_attr(feature = "serde", serde(tag = "type"))]
2767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2768#[repr(u32)]
2769pub enum MavOdidHeightRef {
2770 #[doc = "The height field is relative to the take-off location."]
2771 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2772 #[doc = "The height field is relative to ground."]
2773 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2774}
2775impl MavOdidHeightRef {
2776 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2777}
2778impl Default for MavOdidHeightRef {
2779 fn default() -> Self {
2780 Self::DEFAULT
2781 }
2782}
2783#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2785#[cfg_attr(feature = "serde", serde(tag = "type"))]
2786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2787#[repr(u32)]
2788pub enum MavOdidHorAcc {
2789 #[doc = "The horizontal accuracy is unknown."]
2790 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2791 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2792 MAV_ODID_HOR_ACC_10NM = 1,
2793 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2794 MAV_ODID_HOR_ACC_4NM = 2,
2795 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2796 MAV_ODID_HOR_ACC_2NM = 3,
2797 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2798 MAV_ODID_HOR_ACC_1NM = 4,
2799 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2800 MAV_ODID_HOR_ACC_0_5NM = 5,
2801 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2802 MAV_ODID_HOR_ACC_0_3NM = 6,
2803 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2804 MAV_ODID_HOR_ACC_0_1NM = 7,
2805 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2806 MAV_ODID_HOR_ACC_0_05NM = 8,
2807 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2808 MAV_ODID_HOR_ACC_30_METER = 9,
2809 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2810 MAV_ODID_HOR_ACC_10_METER = 10,
2811 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2812 MAV_ODID_HOR_ACC_3_METER = 11,
2813 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2814 MAV_ODID_HOR_ACC_1_METER = 12,
2815}
2816impl MavOdidHorAcc {
2817 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2818}
2819impl Default for MavOdidHorAcc {
2820 fn default() -> Self {
2821 Self::DEFAULT
2822 }
2823}
2824#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2826#[cfg_attr(feature = "serde", serde(tag = "type"))]
2827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2828#[repr(u32)]
2829pub enum MavOdidIdType {
2830 #[doc = "No type defined."]
2831 MAV_ODID_ID_TYPE_NONE = 0,
2832 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2833 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2834 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2835 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2836 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2837 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2838 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2839 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2840}
2841impl MavOdidIdType {
2842 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2843}
2844impl Default for MavOdidIdType {
2845 fn default() -> Self {
2846 Self::DEFAULT
2847 }
2848}
2849#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2851#[cfg_attr(feature = "serde", serde(tag = "type"))]
2852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2853#[repr(u32)]
2854pub enum MavOdidOperatorIdType {
2855 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2856 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2857}
2858impl MavOdidOperatorIdType {
2859 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2860}
2861impl Default for MavOdidOperatorIdType {
2862 fn default() -> Self {
2863 Self::DEFAULT
2864 }
2865}
2866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2868#[cfg_attr(feature = "serde", serde(tag = "type"))]
2869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2870#[repr(u32)]
2871pub enum MavOdidOperatorLocationType {
2872 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2873 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2874 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2875 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2876 #[doc = "The location/altitude of the operator are fixed values."]
2877 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2878}
2879impl MavOdidOperatorLocationType {
2880 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2881}
2882impl Default for MavOdidOperatorLocationType {
2883 fn default() -> Self {
2884 Self::DEFAULT
2885 }
2886}
2887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2889#[cfg_attr(feature = "serde", serde(tag = "type"))]
2890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2891#[repr(u32)]
2892pub enum MavOdidSpeedAcc {
2893 #[doc = "The speed accuracy is unknown."]
2894 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2895 #[doc = "The speed accuracy is smaller than 10 meters per second."]
2896 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
2897 #[doc = "The speed accuracy is smaller than 3 meters per second."]
2898 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
2899 #[doc = "The speed accuracy is smaller than 1 meters per second."]
2900 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
2901 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
2902 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
2903}
2904impl MavOdidSpeedAcc {
2905 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
2906}
2907impl Default for MavOdidSpeedAcc {
2908 fn default() -> Self {
2909 Self::DEFAULT
2910 }
2911}
2912#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2914#[cfg_attr(feature = "serde", serde(tag = "type"))]
2915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2916#[repr(u32)]
2917pub enum MavOdidStatus {
2918 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2919 MAV_ODID_STATUS_UNDECLARED = 0,
2920 #[doc = "The UA is on the ground."]
2921 MAV_ODID_STATUS_GROUND = 1,
2922 #[doc = "The UA is in the air."]
2923 MAV_ODID_STATUS_AIRBORNE = 2,
2924 #[doc = "The UA is having an emergency."]
2925 MAV_ODID_STATUS_EMERGENCY = 3,
2926 #[doc = "The remote ID system is failing or unreliable in some way."]
2927 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2928}
2929impl MavOdidStatus {
2930 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2931}
2932impl Default for MavOdidStatus {
2933 fn default() -> Self {
2934 Self::DEFAULT
2935 }
2936}
2937#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2939#[cfg_attr(feature = "serde", serde(tag = "type"))]
2940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2941#[repr(u32)]
2942pub enum MavOdidTimeAcc {
2943 #[doc = "The timestamp accuracy is unknown."]
2944 MAV_ODID_TIME_ACC_UNKNOWN = 0,
2945 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
2946 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
2947 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
2948 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
2949 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
2950 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
2951 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
2952 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
2953 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
2954 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
2955 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
2956 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
2957 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
2958 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
2959 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
2960 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
2961 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
2962 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
2963 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
2964 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
2965 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
2966 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
2967 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
2968 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
2969 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
2970 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
2971 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
2972 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
2973 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
2974 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
2975}
2976impl MavOdidTimeAcc {
2977 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
2978}
2979impl Default for MavOdidTimeAcc {
2980 fn default() -> Self {
2981 Self::DEFAULT
2982 }
2983}
2984#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2986#[cfg_attr(feature = "serde", serde(tag = "type"))]
2987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2988#[repr(u32)]
2989pub enum MavOdidUaType {
2990 #[doc = "No UA (Unmanned Aircraft) type defined."]
2991 MAV_ODID_UA_TYPE_NONE = 0,
2992 #[doc = "Aeroplane/Airplane. Fixed wing."]
2993 MAV_ODID_UA_TYPE_AEROPLANE = 1,
2994 #[doc = "Helicopter or multirotor."]
2995 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
2996 #[doc = "Gyroplane."]
2997 MAV_ODID_UA_TYPE_GYROPLANE = 3,
2998 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
2999 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3000 #[doc = "Ornithopter."]
3001 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3002 #[doc = "Glider."]
3003 MAV_ODID_UA_TYPE_GLIDER = 6,
3004 #[doc = "Kite."]
3005 MAV_ODID_UA_TYPE_KITE = 7,
3006 #[doc = "Free Balloon."]
3007 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3008 #[doc = "Captive Balloon."]
3009 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3010 #[doc = "Airship. E.g. a blimp."]
3011 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3012 #[doc = "Free Fall/Parachute (unpowered)."]
3013 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3014 #[doc = "Rocket."]
3015 MAV_ODID_UA_TYPE_ROCKET = 12,
3016 #[doc = "Tethered powered aircraft."]
3017 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3018 #[doc = "Ground Obstacle."]
3019 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3020 #[doc = "Other type of aircraft not listed earlier."]
3021 MAV_ODID_UA_TYPE_OTHER = 15,
3022}
3023impl MavOdidUaType {
3024 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3025}
3026impl Default for MavOdidUaType {
3027 fn default() -> Self {
3028 Self::DEFAULT
3029 }
3030}
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidVerAcc {
3037 #[doc = "The vertical accuracy is unknown."]
3038 MAV_ODID_VER_ACC_UNKNOWN = 0,
3039 #[doc = "The vertical accuracy is smaller than 150 meter."]
3040 MAV_ODID_VER_ACC_150_METER = 1,
3041 #[doc = "The vertical accuracy is smaller than 45 meter."]
3042 MAV_ODID_VER_ACC_45_METER = 2,
3043 #[doc = "The vertical accuracy is smaller than 25 meter."]
3044 MAV_ODID_VER_ACC_25_METER = 3,
3045 #[doc = "The vertical accuracy is smaller than 10 meter."]
3046 MAV_ODID_VER_ACC_10_METER = 4,
3047 #[doc = "The vertical accuracy is smaller than 3 meter."]
3048 MAV_ODID_VER_ACC_3_METER = 5,
3049 #[doc = "The vertical accuracy is smaller than 1 meter."]
3050 MAV_ODID_VER_ACC_1_METER = 6,
3051}
3052impl MavOdidVerAcc {
3053 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3054}
3055impl Default for MavOdidVerAcc {
3056 fn default() -> Self {
3057 Self::DEFAULT
3058 }
3059}
3060#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3062#[cfg_attr(feature = "serde", serde(tag = "type"))]
3063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3064#[repr(u32)]
3065#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3066pub enum MavParamExtType {
3067 #[doc = "8-bit unsigned integer"]
3068 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3069 #[doc = "8-bit signed integer"]
3070 MAV_PARAM_EXT_TYPE_INT8 = 2,
3071 #[doc = "16-bit unsigned integer"]
3072 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3073 #[doc = "16-bit signed integer"]
3074 MAV_PARAM_EXT_TYPE_INT16 = 4,
3075 #[doc = "32-bit unsigned integer"]
3076 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3077 #[doc = "32-bit signed integer"]
3078 MAV_PARAM_EXT_TYPE_INT32 = 6,
3079 #[doc = "64-bit unsigned integer"]
3080 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3081 #[doc = "64-bit signed integer"]
3082 MAV_PARAM_EXT_TYPE_INT64 = 8,
3083 #[doc = "32-bit floating-point"]
3084 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3085 #[doc = "64-bit floating-point"]
3086 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3087 #[doc = "Custom Type"]
3088 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3089}
3090impl MavParamExtType {
3091 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3092}
3093impl Default for MavParamExtType {
3094 fn default() -> Self {
3095 Self::DEFAULT
3096 }
3097}
3098#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3100#[cfg_attr(feature = "serde", serde(tag = "type"))]
3101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3102#[repr(u32)]
3103#[doc = "Specifies the datatype of a MAVLink parameter."]
3104pub enum MavParamType {
3105 #[doc = "8-bit unsigned integer"]
3106 MAV_PARAM_TYPE_UINT8 = 1,
3107 #[doc = "8-bit signed integer"]
3108 MAV_PARAM_TYPE_INT8 = 2,
3109 #[doc = "16-bit unsigned integer"]
3110 MAV_PARAM_TYPE_UINT16 = 3,
3111 #[doc = "16-bit signed integer"]
3112 MAV_PARAM_TYPE_INT16 = 4,
3113 #[doc = "32-bit unsigned integer"]
3114 MAV_PARAM_TYPE_UINT32 = 5,
3115 #[doc = "32-bit signed integer"]
3116 MAV_PARAM_TYPE_INT32 = 6,
3117 #[doc = "64-bit unsigned integer"]
3118 MAV_PARAM_TYPE_UINT64 = 7,
3119 #[doc = "64-bit signed integer"]
3120 MAV_PARAM_TYPE_INT64 = 8,
3121 #[doc = "32-bit floating-point"]
3122 MAV_PARAM_TYPE_REAL32 = 9,
3123 #[doc = "64-bit floating-point"]
3124 MAV_PARAM_TYPE_REAL64 = 10,
3125}
3126impl MavParamType {
3127 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3128}
3129impl Default for MavParamType {
3130 fn default() -> Self {
3131 Self::DEFAULT
3132 }
3133}
3134bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3135impl MavPowerStatus {
3136 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3137}
3138impl Default for MavPowerStatus {
3139 fn default() -> Self {
3140 Self::DEFAULT
3141 }
3142}
3143bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3144impl MavProtocolCapability {
3145 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3146}
3147impl Default for MavProtocolCapability {
3148 fn default() -> Self {
3149 Self::DEFAULT
3150 }
3151}
3152#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3154#[cfg_attr(feature = "serde", serde(tag = "type"))]
3155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3156#[repr(u32)]
3157#[doc = "Result from a MAVLink command (MAV_CMD)"]
3158pub enum MavResult {
3159 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3160 MAV_RESULT_ACCEPTED = 0,
3161 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3162 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3163 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3164 MAV_RESULT_DENIED = 2,
3165 #[doc = "Command is not supported (unknown)."]
3166 MAV_RESULT_UNSUPPORTED = 3,
3167 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3168 MAV_RESULT_FAILED = 4,
3169 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3170 MAV_RESULT_IN_PROGRESS = 5,
3171 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3172 MAV_RESULT_CANCELLED = 6,
3173 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3174 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3175 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3176 MAV_RESULT_COMMAND_INT_ONLY = 8,
3177 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3178 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3179}
3180impl MavResult {
3181 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3182}
3183impl Default for MavResult {
3184 fn default() -> Self {
3185 Self::DEFAULT
3186 }
3187}
3188#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3190#[cfg_attr(feature = "serde", serde(tag = "type"))]
3191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3192#[repr(u32)]
3193#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3194#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3195pub enum MavRoi {
3196 #[doc = "No region of interest."]
3197 MAV_ROI_NONE = 0,
3198 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3199 MAV_ROI_WPNEXT = 1,
3200 #[doc = "Point toward given waypoint."]
3201 MAV_ROI_WPINDEX = 2,
3202 #[doc = "Point toward fixed location."]
3203 MAV_ROI_LOCATION = 3,
3204 #[doc = "Point toward of given id."]
3205 MAV_ROI_TARGET = 4,
3206}
3207impl MavRoi {
3208 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3209}
3210impl Default for MavRoi {
3211 fn default() -> Self {
3212 Self::DEFAULT
3213 }
3214}
3215#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3217#[cfg_attr(feature = "serde", serde(tag = "type"))]
3218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3219#[repr(u32)]
3220#[doc = "Enumeration of sensor orientation, according to its rotations"]
3221pub enum MavSensorOrientation {
3222 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3223 MAV_SENSOR_ROTATION_NONE = 0,
3224 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3225 MAV_SENSOR_ROTATION_YAW_45 = 1,
3226 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3227 MAV_SENSOR_ROTATION_YAW_90 = 2,
3228 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3229 MAV_SENSOR_ROTATION_YAW_135 = 3,
3230 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3231 MAV_SENSOR_ROTATION_YAW_180 = 4,
3232 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3233 MAV_SENSOR_ROTATION_YAW_225 = 5,
3234 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3235 MAV_SENSOR_ROTATION_YAW_270 = 6,
3236 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3237 MAV_SENSOR_ROTATION_YAW_315 = 7,
3238 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3239 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3240 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3241 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3242 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3243 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3244 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3245 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3246 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3247 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3248 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3249 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3250 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3251 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3252 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3253 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3254 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3255 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3256 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3257 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3258 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3259 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3260 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3261 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3262 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3263 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3264 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3265 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3266 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3267 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3268 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3269 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3270 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3271 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3272 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3273 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3274 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3275 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3276 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3277 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3278 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3279 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3280 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3281 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3282 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3283 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3284 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3285 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3286 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3287 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3288 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3289 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3290 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3291 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3292 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3293 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3294 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3295 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3296 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3297 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3298 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3299 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3300 #[doc = "Pitch: 315"]
3301 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3302 #[doc = "Roll: 90, Pitch: 315"]
3303 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3304 #[doc = "Custom orientation"]
3305 MAV_SENSOR_ROTATION_CUSTOM = 100,
3306}
3307impl MavSensorOrientation {
3308 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3309}
3310impl Default for MavSensorOrientation {
3311 fn default() -> Self {
3312 Self::DEFAULT
3313 }
3314}
3315#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3317#[cfg_attr(feature = "serde", serde(tag = "type"))]
3318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3319#[repr(u32)]
3320#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3321pub enum MavSeverity {
3322 #[doc = "System is unusable. This is a \"panic\" condition."]
3323 MAV_SEVERITY_EMERGENCY = 0,
3324 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3325 MAV_SEVERITY_ALERT = 1,
3326 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3327 MAV_SEVERITY_CRITICAL = 2,
3328 #[doc = "Indicates an error in secondary/redundant systems."]
3329 MAV_SEVERITY_ERROR = 3,
3330 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3331 MAV_SEVERITY_WARNING = 4,
3332 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3333 MAV_SEVERITY_NOTICE = 5,
3334 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3335 MAV_SEVERITY_INFO = 6,
3336 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3337 MAV_SEVERITY_DEBUG = 7,
3338}
3339impl MavSeverity {
3340 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3341}
3342impl Default for MavSeverity {
3343 fn default() -> Self {
3344 Self::DEFAULT
3345 }
3346}
3347#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3348#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3349#[cfg_attr(feature = "serde", serde(tag = "type"))]
3350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3351#[repr(u32)]
3352#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3353pub enum MavStandardMode {
3354 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3355 MAV_STANDARD_MODE_NON_STANDARD = 0,
3356 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3357 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3358 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3359 MAV_STANDARD_MODE_ORBIT = 2,
3360 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3361 MAV_STANDARD_MODE_CRUISE = 3,
3362 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3363 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3364 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3365 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3366 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3367 MAV_STANDARD_MODE_MISSION = 6,
3368 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3369 MAV_STANDARD_MODE_LAND = 7,
3370 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3371 MAV_STANDARD_MODE_TAKEOFF = 8,
3372}
3373impl MavStandardMode {
3374 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3375}
3376impl Default for MavStandardMode {
3377 fn default() -> Self {
3378 Self::DEFAULT
3379 }
3380}
3381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3383#[cfg_attr(feature = "serde", serde(tag = "type"))]
3384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3385#[repr(u32)]
3386pub enum MavState {
3387 #[doc = "Uninitialized system, state is unknown."]
3388 MAV_STATE_UNINIT = 0,
3389 #[doc = "System is booting up."]
3390 MAV_STATE_BOOT = 1,
3391 #[doc = "System is calibrating and not flight-ready."]
3392 MAV_STATE_CALIBRATING = 2,
3393 #[doc = "System is grounded and on standby. It can be launched any time."]
3394 MAV_STATE_STANDBY = 3,
3395 #[doc = "System is active and might be already airborne. Motors are engaged."]
3396 MAV_STATE_ACTIVE = 4,
3397 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3398 MAV_STATE_CRITICAL = 5,
3399 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3400 MAV_STATE_EMERGENCY = 6,
3401 #[doc = "System just initialized its power-down sequence, will shut down now."]
3402 MAV_STATE_POWEROFF = 7,
3403 #[doc = "System is terminating itself (failsafe or commanded)."]
3404 MAV_STATE_FLIGHT_TERMINATION = 8,
3405}
3406impl MavState {
3407 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3408}
3409impl Default for MavState {
3410 fn default() -> Self {
3411 Self::DEFAULT
3412 }
3413}
3414bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3415impl MavSysStatusSensor {
3416 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3417}
3418impl Default for MavSysStatusSensor {
3419 fn default() -> Self {
3420 Self::DEFAULT
3421 }
3422}
3423bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3424impl MavSysStatusSensorExtended {
3425 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3426}
3427impl Default for MavSysStatusSensorExtended {
3428 fn default() -> Self {
3429 Self::DEFAULT
3430 }
3431}
3432#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3434#[cfg_attr(feature = "serde", serde(tag = "type"))]
3435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3436#[repr(u32)]
3437pub enum MavTunnelPayloadType {
3438 #[doc = "Encoding of payload unknown."]
3439 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3440 #[doc = "Registered for STorM32 gimbal controller."]
3441 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3442 #[doc = "Registered for STorM32 gimbal controller."]
3443 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3444 #[doc = "Registered for STorM32 gimbal controller."]
3445 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3446 #[doc = "Registered for STorM32 gimbal controller."]
3447 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3448 #[doc = "Registered for STorM32 gimbal controller."]
3449 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3450 #[doc = "Registered for STorM32 gimbal controller."]
3451 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3452 #[doc = "Registered for STorM32 gimbal controller."]
3453 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3454 #[doc = "Registered for STorM32 gimbal controller."]
3455 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3456 #[doc = "Registered for STorM32 gimbal controller."]
3457 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3458 #[doc = "Registered for STorM32 gimbal controller."]
3459 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3460 #[doc = "Registered for ModalAI remote OSD protocol."]
3461 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3462 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3463 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3464 #[doc = "Registered for ModalAI vendor use."]
3465 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3466}
3467impl MavTunnelPayloadType {
3468 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3469}
3470impl Default for MavTunnelPayloadType {
3471 fn default() -> Self {
3472 Self::DEFAULT
3473 }
3474}
3475#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3477#[cfg_attr(feature = "serde", serde(tag = "type"))]
3478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3479#[repr(u32)]
3480#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3481pub enum MavType {
3482 #[doc = "Generic micro air vehicle"]
3483 MAV_TYPE_GENERIC = 0,
3484 #[doc = "Fixed wing aircraft."]
3485 MAV_TYPE_FIXED_WING = 1,
3486 #[doc = "Quadrotor"]
3487 MAV_TYPE_QUADROTOR = 2,
3488 #[doc = "Coaxial helicopter"]
3489 MAV_TYPE_COAXIAL = 3,
3490 #[doc = "Normal helicopter with tail rotor."]
3491 MAV_TYPE_HELICOPTER = 4,
3492 #[doc = "Ground installation"]
3493 MAV_TYPE_ANTENNA_TRACKER = 5,
3494 #[doc = "Operator control unit / ground control station"]
3495 MAV_TYPE_GCS = 6,
3496 #[doc = "Airship, controlled"]
3497 MAV_TYPE_AIRSHIP = 7,
3498 #[doc = "Free balloon, uncontrolled"]
3499 MAV_TYPE_FREE_BALLOON = 8,
3500 #[doc = "Rocket"]
3501 MAV_TYPE_ROCKET = 9,
3502 #[doc = "Ground rover"]
3503 MAV_TYPE_GROUND_ROVER = 10,
3504 #[doc = "Surface vessel, boat, ship"]
3505 MAV_TYPE_SURFACE_BOAT = 11,
3506 #[doc = "Submarine"]
3507 MAV_TYPE_SUBMARINE = 12,
3508 #[doc = "Hexarotor"]
3509 MAV_TYPE_HEXAROTOR = 13,
3510 #[doc = "Octorotor"]
3511 MAV_TYPE_OCTOROTOR = 14,
3512 #[doc = "Tricopter"]
3513 MAV_TYPE_TRICOPTER = 15,
3514 #[doc = "Flapping wing"]
3515 MAV_TYPE_FLAPPING_WING = 16,
3516 #[doc = "Kite"]
3517 MAV_TYPE_KITE = 17,
3518 #[doc = "Onboard companion controller"]
3519 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3520 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3521 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3522 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3523 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3524 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3525 MAV_TYPE_VTOL_TILTROTOR = 21,
3526 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3527 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3528 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3529 MAV_TYPE_VTOL_TAILSITTER = 23,
3530 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3531 MAV_TYPE_VTOL_TILTWING = 24,
3532 #[doc = "VTOL reserved 5"]
3533 MAV_TYPE_VTOL_RESERVED5 = 25,
3534 #[doc = "Gimbal"]
3535 MAV_TYPE_GIMBAL = 26,
3536 #[doc = "ADSB system"]
3537 MAV_TYPE_ADSB = 27,
3538 #[doc = "Steerable, nonrigid airfoil"]
3539 MAV_TYPE_PARAFOIL = 28,
3540 #[doc = "Dodecarotor"]
3541 MAV_TYPE_DODECAROTOR = 29,
3542 #[doc = "Camera"]
3543 MAV_TYPE_CAMERA = 30,
3544 #[doc = "Charging station"]
3545 MAV_TYPE_CHARGING_STATION = 31,
3546 #[doc = "FLARM collision avoidance system"]
3547 MAV_TYPE_FLARM = 32,
3548 #[doc = "Servo"]
3549 MAV_TYPE_SERVO = 33,
3550 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3551 MAV_TYPE_ODID = 34,
3552 #[doc = "Decarotor"]
3553 MAV_TYPE_DECAROTOR = 35,
3554 #[doc = "Battery"]
3555 MAV_TYPE_BATTERY = 36,
3556 #[doc = "Parachute"]
3557 MAV_TYPE_PARACHUTE = 37,
3558 #[doc = "Log"]
3559 MAV_TYPE_LOG = 38,
3560 #[doc = "OSD"]
3561 MAV_TYPE_OSD = 39,
3562 #[doc = "IMU"]
3563 MAV_TYPE_IMU = 40,
3564 #[doc = "GPS"]
3565 MAV_TYPE_GPS = 41,
3566 #[doc = "Winch"]
3567 MAV_TYPE_WINCH = 42,
3568 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3569 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3570 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3571 MAV_TYPE_ILLUMINATOR = 44,
3572 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3573 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3574}
3575impl MavType {
3576 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3577}
3578impl Default for MavType {
3579 fn default() -> Self {
3580 Self::DEFAULT
3581 }
3582}
3583#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3585#[cfg_attr(feature = "serde", serde(tag = "type"))]
3586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3587#[repr(u32)]
3588#[doc = "Enumeration of VTOL states"]
3589pub enum MavVtolState {
3590 #[doc = "MAV is not configured as VTOL"]
3591 MAV_VTOL_STATE_UNDEFINED = 0,
3592 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3593 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3594 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3595 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3596 #[doc = "VTOL is in multicopter state"]
3597 MAV_VTOL_STATE_MC = 3,
3598 #[doc = "VTOL is in fixed-wing state"]
3599 MAV_VTOL_STATE_FW = 4,
3600}
3601impl MavVtolState {
3602 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3603}
3604impl Default for MavVtolState {
3605 fn default() -> Self {
3606 Self::DEFAULT
3607 }
3608}
3609bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3610impl MavWinchStatusFlag {
3611 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3612}
3613impl Default for MavWinchStatusFlag {
3614 fn default() -> Self {
3615 Self::DEFAULT
3616 }
3617}
3618#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3620#[cfg_attr(feature = "serde", serde(tag = "type"))]
3621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3622#[repr(u32)]
3623pub enum MavlinkDataStreamType {
3624 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3625 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3626 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3627 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3628 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3629 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3630}
3631impl MavlinkDataStreamType {
3632 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3633}
3634impl Default for MavlinkDataStreamType {
3635 fn default() -> Self {
3636 Self::DEFAULT
3637 }
3638}
3639#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3641#[cfg_attr(feature = "serde", serde(tag = "type"))]
3642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3643#[repr(u32)]
3644#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3645pub enum MissionState {
3646 #[doc = "The mission status reporting is not supported."]
3647 MISSION_STATE_UNKNOWN = 0,
3648 #[doc = "No mission on the vehicle."]
3649 MISSION_STATE_NO_MISSION = 1,
3650 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3651 MISSION_STATE_NOT_STARTED = 2,
3652 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3653 MISSION_STATE_ACTIVE = 3,
3654 #[doc = "Mission is paused when in auto mode."]
3655 MISSION_STATE_PAUSED = 4,
3656 #[doc = "Mission has executed all mission items."]
3657 MISSION_STATE_COMPLETE = 5,
3658}
3659impl MissionState {
3660 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3661}
3662impl Default for MissionState {
3663 fn default() -> Self {
3664 Self::DEFAULT
3665 }
3666}
3667#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3668#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3669#[cfg_attr(feature = "serde", serde(tag = "type"))]
3670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3671#[repr(u32)]
3672#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3673pub enum MotorTestOrder {
3674 #[doc = "Default autopilot motor test method."]
3675 MOTOR_TEST_ORDER_DEFAULT = 0,
3676 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3677 MOTOR_TEST_ORDER_SEQUENCE = 1,
3678 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3679 MOTOR_TEST_ORDER_BOARD = 2,
3680}
3681impl MotorTestOrder {
3682 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3683}
3684impl Default for MotorTestOrder {
3685 fn default() -> Self {
3686 Self::DEFAULT
3687 }
3688}
3689#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3691#[cfg_attr(feature = "serde", serde(tag = "type"))]
3692#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3693#[repr(u32)]
3694#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3695pub enum MotorTestThrottleType {
3696 #[doc = "Throttle as a percentage (0 ~ 100)"]
3697 MOTOR_TEST_THROTTLE_PERCENT = 0,
3698 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3699 MOTOR_TEST_THROTTLE_PWM = 1,
3700 #[doc = "Throttle pass-through from pilot's transmitter."]
3701 MOTOR_TEST_THROTTLE_PILOT = 2,
3702 #[doc = "Per-motor compass calibration test."]
3703 MOTOR_TEST_COMPASS_CAL = 3,
3704}
3705impl MotorTestThrottleType {
3706 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3707}
3708impl Default for MotorTestThrottleType {
3709 fn default() -> Self {
3710 Self::DEFAULT
3711 }
3712}
3713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3715#[cfg_attr(feature = "serde", serde(tag = "type"))]
3716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3717#[repr(u32)]
3718pub enum NavVtolLandOptions {
3719 #[doc = "Default autopilot landing behaviour."]
3720 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3721 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3722 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3723 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3724 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3725}
3726impl NavVtolLandOptions {
3727 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3728}
3729impl Default for NavVtolLandOptions {
3730 fn default() -> Self {
3731 Self::DEFAULT
3732 }
3733}
3734#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3736#[cfg_attr(feature = "serde", serde(tag = "type"))]
3737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3738#[repr(u32)]
3739#[doc = "Yaw behaviour during orbit flight."]
3740pub enum OrbitYawBehaviour {
3741 #[doc = "Vehicle front points to the center (default)."]
3742 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3743 #[doc = "Vehicle front holds heading when message received."]
3744 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3745 #[doc = "Yaw uncontrolled."]
3746 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3747 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3748 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3749 #[doc = "Yaw controlled by RC input."]
3750 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3751 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3752 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3753}
3754impl OrbitYawBehaviour {
3755 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3756}
3757impl Default for OrbitYawBehaviour {
3758 fn default() -> Self {
3759 Self::DEFAULT
3760 }
3761}
3762#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3763#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3764#[cfg_attr(feature = "serde", serde(tag = "type"))]
3765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3766#[repr(u32)]
3767#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3768pub enum ParachuteAction {
3769 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3770 PARACHUTE_DISABLE = 0,
3771 #[doc = "Enable auto-release of parachute."]
3772 PARACHUTE_ENABLE = 1,
3773 #[doc = "Release parachute and kill motors."]
3774 PARACHUTE_RELEASE = 2,
3775}
3776impl ParachuteAction {
3777 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3778}
3779impl Default for ParachuteAction {
3780 fn default() -> Self {
3781 Self::DEFAULT
3782 }
3783}
3784#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3786#[cfg_attr(feature = "serde", serde(tag = "type"))]
3787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3788#[repr(u32)]
3789#[doc = "Result from PARAM_EXT_SET message."]
3790pub enum ParamAck {
3791 #[doc = "Parameter value ACCEPTED and SET"]
3792 PARAM_ACK_ACCEPTED = 0,
3793 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3794 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3795 #[doc = "Parameter failed to set"]
3796 PARAM_ACK_FAILED = 2,
3797 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3798 PARAM_ACK_IN_PROGRESS = 3,
3799}
3800impl ParamAck {
3801 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3802}
3803impl Default for ParamAck {
3804 fn default() -> Self {
3805 Self::DEFAULT
3806 }
3807}
3808bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3809impl PositionTargetTypemask {
3810 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3811}
3812impl Default for PositionTargetTypemask {
3813 fn default() -> Self {
3814 Self::DEFAULT
3815 }
3816}
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3823pub enum PrecisionLandMode {
3824 #[doc = "Normal (non-precision) landing."]
3825 PRECISION_LAND_MODE_DISABLED = 0,
3826 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3827 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3828 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3829 PRECISION_LAND_MODE_REQUIRED = 2,
3830}
3831impl PrecisionLandMode {
3832 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3833}
3834impl Default for PrecisionLandMode {
3835 fn default() -> Self {
3836 Self::DEFAULT
3837 }
3838}
3839#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3841#[cfg_attr(feature = "serde", serde(tag = "type"))]
3842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3843#[repr(u32)]
3844#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3845pub enum PreflightStorageMissionAction {
3846 #[doc = "Read current mission data from persistent storage"]
3847 MISSION_READ_PERSISTENT = 0,
3848 #[doc = "Write current mission data to persistent storage"]
3849 MISSION_WRITE_PERSISTENT = 1,
3850 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3851 MISSION_RESET_DEFAULT = 2,
3852}
3853impl PreflightStorageMissionAction {
3854 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3855}
3856impl Default for PreflightStorageMissionAction {
3857 fn default() -> Self {
3858 Self::DEFAULT
3859 }
3860}
3861#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3863#[cfg_attr(feature = "serde", serde(tag = "type"))]
3864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3865#[repr(u32)]
3866#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3867pub enum PreflightStorageParameterAction {
3868 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3869 PARAM_READ_PERSISTENT = 0,
3870 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3871 PARAM_WRITE_PERSISTENT = 1,
3872 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3873 PARAM_RESET_CONFIG_DEFAULT = 2,
3874 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3875 PARAM_RESET_SENSOR_DEFAULT = 3,
3876 #[doc = "Reset all parameters, including operation counters, to default values"]
3877 PARAM_RESET_ALL_DEFAULT = 4,
3878}
3879impl PreflightStorageParameterAction {
3880 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3881}
3882impl Default for PreflightStorageParameterAction {
3883 fn default() -> Self {
3884 Self::DEFAULT
3885 }
3886}
3887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3889#[cfg_attr(feature = "serde", serde(tag = "type"))]
3890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3891#[repr(u32)]
3892#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3893pub enum RcSubType {
3894 #[doc = "Spektrum DSM2"]
3895 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
3896 #[doc = "Spektrum DSMX"]
3897 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
3898 #[doc = "Spektrum DSMX8"]
3899 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
3900}
3901impl RcSubType {
3902 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
3903}
3904impl Default for RcSubType {
3905 fn default() -> Self {
3906 Self::DEFAULT
3907 }
3908}
3909#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3911#[cfg_attr(feature = "serde", serde(tag = "type"))]
3912#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3913#[repr(u32)]
3914#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3915pub enum RcType {
3916 #[doc = "Spektrum"]
3917 RC_TYPE_SPEKTRUM = 0,
3918 #[doc = "CRSF"]
3919 RC_TYPE_CRSF = 1,
3920}
3921impl RcType {
3922 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3923}
3924impl Default for RcType {
3925 fn default() -> Self {
3926 Self::DEFAULT
3927 }
3928}
3929#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3931#[cfg_attr(feature = "serde", serde(tag = "type"))]
3932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3933#[repr(u32)]
3934#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
3935pub enum RebootShutdownConditions {
3936 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
3937 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
3938 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
3939 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
3940}
3941impl RebootShutdownConditions {
3942 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
3943}
3944impl Default for RebootShutdownConditions {
3945 fn default() -> Self {
3946 Self::DEFAULT
3947 }
3948}
3949#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3951#[cfg_attr(feature = "serde", serde(tag = "type"))]
3952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3953#[repr(u32)]
3954#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
3955pub enum RtkBaselineCoordinateSystem {
3956 #[doc = "Earth-centered, Earth-fixed"]
3957 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
3958 #[doc = "RTK basestation centered, north, east, down"]
3959 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
3960}
3961impl RtkBaselineCoordinateSystem {
3962 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
3963}
3964impl Default for RtkBaselineCoordinateSystem {
3965 fn default() -> Self {
3966 Self::DEFAULT
3967 }
3968}
3969#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3971#[cfg_attr(feature = "serde", serde(tag = "type"))]
3972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3973#[repr(u32)]
3974#[doc = "Possible safety switch states."]
3975pub enum SafetySwitchState {
3976 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
3977 SAFETY_SWITCH_STATE_SAFE = 0,
3978 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
3979 SAFETY_SWITCH_STATE_DANGEROUS = 1,
3980}
3981impl SafetySwitchState {
3982 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
3983}
3984impl Default for SafetySwitchState {
3985 fn default() -> Self {
3986 Self::DEFAULT
3987 }
3988}
3989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3991#[cfg_attr(feature = "serde", serde(tag = "type"))]
3992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3993#[repr(u32)]
3994#[doc = "SERIAL_CONTROL device types"]
3995pub enum SerialControlDev {
3996 #[doc = "First telemetry port"]
3997 SERIAL_CONTROL_DEV_TELEM1 = 0,
3998 #[doc = "Second telemetry port"]
3999 SERIAL_CONTROL_DEV_TELEM2 = 1,
4000 #[doc = "First GPS port"]
4001 SERIAL_CONTROL_DEV_GPS1 = 2,
4002 #[doc = "Second GPS port"]
4003 SERIAL_CONTROL_DEV_GPS2 = 3,
4004 #[doc = "system shell"]
4005 SERIAL_CONTROL_DEV_SHELL = 10,
4006 #[doc = "SERIAL0"]
4007 SERIAL_CONTROL_SERIAL0 = 100,
4008 #[doc = "SERIAL1"]
4009 SERIAL_CONTROL_SERIAL1 = 101,
4010 #[doc = "SERIAL2"]
4011 SERIAL_CONTROL_SERIAL2 = 102,
4012 #[doc = "SERIAL3"]
4013 SERIAL_CONTROL_SERIAL3 = 103,
4014 #[doc = "SERIAL4"]
4015 SERIAL_CONTROL_SERIAL4 = 104,
4016 #[doc = "SERIAL5"]
4017 SERIAL_CONTROL_SERIAL5 = 105,
4018 #[doc = "SERIAL6"]
4019 SERIAL_CONTROL_SERIAL6 = 106,
4020 #[doc = "SERIAL7"]
4021 SERIAL_CONTROL_SERIAL7 = 107,
4022 #[doc = "SERIAL8"]
4023 SERIAL_CONTROL_SERIAL8 = 108,
4024 #[doc = "SERIAL9"]
4025 SERIAL_CONTROL_SERIAL9 = 109,
4026}
4027impl SerialControlDev {
4028 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4029}
4030impl Default for SerialControlDev {
4031 fn default() -> Self {
4032 Self::DEFAULT
4033 }
4034}
4035bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4036impl SerialControlFlag {
4037 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4038}
4039impl Default for SerialControlFlag {
4040 fn default() -> Self {
4041 Self::DEFAULT
4042 }
4043}
4044#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4046#[cfg_attr(feature = "serde", serde(tag = "type"))]
4047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4048#[repr(u32)]
4049#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4050pub enum SetFocusType {
4051 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4052 FOCUS_TYPE_STEP = 0,
4053 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4054 FOCUS_TYPE_CONTINUOUS = 1,
4055 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4056 FOCUS_TYPE_RANGE = 2,
4057 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4058 FOCUS_TYPE_METERS = 3,
4059 #[doc = "Focus automatically."]
4060 FOCUS_TYPE_AUTO = 4,
4061 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4062 FOCUS_TYPE_AUTO_SINGLE = 5,
4063 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4064 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4065}
4066impl SetFocusType {
4067 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4068}
4069impl Default for SetFocusType {
4070 fn default() -> Self {
4071 Self::DEFAULT
4072 }
4073}
4074#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4075#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4076#[cfg_attr(feature = "serde", serde(tag = "type"))]
4077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4078#[repr(u32)]
4079#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4080pub enum SpeedType {
4081 #[doc = "Airspeed"]
4082 SPEED_TYPE_AIRSPEED = 0,
4083 #[doc = "Groundspeed"]
4084 SPEED_TYPE_GROUNDSPEED = 1,
4085 #[doc = "Climb speed"]
4086 SPEED_TYPE_CLIMB_SPEED = 2,
4087 #[doc = "Descent speed"]
4088 SPEED_TYPE_DESCENT_SPEED = 3,
4089}
4090impl SpeedType {
4091 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4092}
4093impl Default for SpeedType {
4094 fn default() -> Self {
4095 Self::DEFAULT
4096 }
4097}
4098#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4100#[cfg_attr(feature = "serde", serde(tag = "type"))]
4101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4102#[repr(u32)]
4103#[doc = "Flags to indicate the status of camera storage."]
4104pub enum StorageStatus {
4105 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4106 STORAGE_STATUS_EMPTY = 0,
4107 #[doc = "Storage present but unformatted."]
4108 STORAGE_STATUS_UNFORMATTED = 1,
4109 #[doc = "Storage present and ready."]
4110 STORAGE_STATUS_READY = 2,
4111 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4112 STORAGE_STATUS_NOT_SUPPORTED = 3,
4113}
4114impl StorageStatus {
4115 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4116}
4117impl Default for StorageStatus {
4118 fn default() -> Self {
4119 Self::DEFAULT
4120 }
4121}
4122#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4124#[cfg_attr(feature = "serde", serde(tag = "type"))]
4125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4126#[repr(u32)]
4127#[doc = "Flags to indicate the type of storage."]
4128pub enum StorageType {
4129 #[doc = "Storage type is not known."]
4130 STORAGE_TYPE_UNKNOWN = 0,
4131 #[doc = "Storage type is USB device."]
4132 STORAGE_TYPE_USB_STICK = 1,
4133 #[doc = "Storage type is SD card."]
4134 STORAGE_TYPE_SD = 2,
4135 #[doc = "Storage type is microSD card."]
4136 STORAGE_TYPE_MICROSD = 3,
4137 #[doc = "Storage type is CFast."]
4138 STORAGE_TYPE_CF = 4,
4139 #[doc = "Storage type is CFexpress."]
4140 STORAGE_TYPE_CFE = 5,
4141 #[doc = "Storage type is XQD."]
4142 STORAGE_TYPE_XQD = 6,
4143 #[doc = "Storage type is HD mass storage type."]
4144 STORAGE_TYPE_HD = 7,
4145 #[doc = "Storage type is other, not listed type."]
4146 STORAGE_TYPE_OTHER = 254,
4147}
4148impl StorageType {
4149 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4150}
4151impl Default for StorageType {
4152 fn default() -> Self {
4153 Self::DEFAULT
4154 }
4155}
4156bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4157impl StorageUsageFlag {
4158 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4159}
4160impl Default for StorageUsageFlag {
4161 fn default() -> Self {
4162 Self::DEFAULT
4163 }
4164}
4165#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4167#[cfg_attr(feature = "serde", serde(tag = "type"))]
4168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4169#[repr(u32)]
4170#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4171pub enum TuneFormat {
4172 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4173 TUNE_FORMAT_QBASIC1_1 = 1,
4174 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4175 TUNE_FORMAT_MML_MODERN = 2,
4176}
4177impl TuneFormat {
4178 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4179}
4180impl Default for TuneFormat {
4181 fn default() -> Self {
4182 Self::DEFAULT
4183 }
4184}
4185#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4187#[cfg_attr(feature = "serde", serde(tag = "type"))]
4188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4189#[repr(u32)]
4190#[doc = "Generalized UAVCAN node health"]
4191pub enum UavcanNodeHealth {
4192 #[doc = "The node is functioning properly."]
4193 UAVCAN_NODE_HEALTH_OK = 0,
4194 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4195 UAVCAN_NODE_HEALTH_WARNING = 1,
4196 #[doc = "The node has encountered a major failure."]
4197 UAVCAN_NODE_HEALTH_ERROR = 2,
4198 #[doc = "The node has suffered a fatal malfunction."]
4199 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4200}
4201impl UavcanNodeHealth {
4202 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4203}
4204impl Default for UavcanNodeHealth {
4205 fn default() -> Self {
4206 Self::DEFAULT
4207 }
4208}
4209#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4211#[cfg_attr(feature = "serde", serde(tag = "type"))]
4212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4213#[repr(u32)]
4214#[doc = "Generalized UAVCAN node mode"]
4215pub enum UavcanNodeMode {
4216 #[doc = "The node is performing its primary functions."]
4217 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4218 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4219 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4220 #[doc = "The node is under maintenance."]
4221 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4222 #[doc = "The node is in the process of updating its software."]
4223 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4224 #[doc = "The node is no longer available online."]
4225 UAVCAN_NODE_MODE_OFFLINE = 7,
4226}
4227impl UavcanNodeMode {
4228 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4229}
4230impl Default for UavcanNodeMode {
4231 fn default() -> Self {
4232 Self::DEFAULT
4233 }
4234}
4235bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4236impl UtmDataAvailFlags {
4237 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4238}
4239impl Default for UtmDataAvailFlags {
4240 fn default() -> Self {
4241 Self::DEFAULT
4242 }
4243}
4244#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4246#[cfg_attr(feature = "serde", serde(tag = "type"))]
4247#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4248#[repr(u32)]
4249#[doc = "Airborne status of UAS."]
4250pub enum UtmFlightState {
4251 #[doc = "The flight state can't be determined."]
4252 UTM_FLIGHT_STATE_UNKNOWN = 1,
4253 #[doc = "UAS on ground."]
4254 UTM_FLIGHT_STATE_GROUND = 2,
4255 #[doc = "UAS airborne."]
4256 UTM_FLIGHT_STATE_AIRBORNE = 3,
4257 #[doc = "UAS is in an emergency flight state."]
4258 UTM_FLIGHT_STATE_EMERGENCY = 16,
4259 #[doc = "UAS has no active controls."]
4260 UTM_FLIGHT_STATE_NOCTRL = 32,
4261}
4262impl UtmFlightState {
4263 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4264}
4265impl Default for UtmFlightState {
4266 fn default() -> Self {
4267 Self::DEFAULT
4268 }
4269}
4270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4272#[cfg_attr(feature = "serde", serde(tag = "type"))]
4273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4274#[repr(u32)]
4275#[doc = "Video stream encodings"]
4276pub enum VideoStreamEncoding {
4277 #[doc = "Stream encoding is unknown"]
4278 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4279 #[doc = "Stream encoding is H.264"]
4280 VIDEO_STREAM_ENCODING_H264 = 1,
4281 #[doc = "Stream encoding is H.265"]
4282 VIDEO_STREAM_ENCODING_H265 = 2,
4283}
4284impl VideoStreamEncoding {
4285 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4286}
4287impl Default for VideoStreamEncoding {
4288 fn default() -> Self {
4289 Self::DEFAULT
4290 }
4291}
4292bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4293impl VideoStreamStatusFlags {
4294 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4295}
4296impl Default for VideoStreamStatusFlags {
4297 fn default() -> Self {
4298 Self::DEFAULT
4299 }
4300}
4301#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4303#[cfg_attr(feature = "serde", serde(tag = "type"))]
4304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4305#[repr(u32)]
4306#[doc = "Video stream types"]
4307pub enum VideoStreamType {
4308 #[doc = "Stream is RTSP"]
4309 VIDEO_STREAM_TYPE_RTSP = 0,
4310 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4311 VIDEO_STREAM_TYPE_RTPUDP = 1,
4312 #[doc = "Stream is MPEG on TCP"]
4313 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4314 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4315 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4316}
4317impl VideoStreamType {
4318 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4319}
4320impl Default for VideoStreamType {
4321 fn default() -> Self {
4322 Self::DEFAULT
4323 }
4324}
4325#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4326#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4327#[cfg_attr(feature = "serde", serde(tag = "type"))]
4328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4329#[repr(u32)]
4330#[doc = "Direction of VTOL transition"]
4331pub enum VtolTransitionHeading {
4332 #[doc = "Respect the heading configuration of the vehicle."]
4333 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4334 #[doc = "Use the heading pointing towards the next waypoint."]
4335 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4336 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4337 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4338 #[doc = "Use the specified heading in parameter 4."]
4339 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4340 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4341 VTOL_TRANSITION_HEADING_ANY = 4,
4342}
4343impl VtolTransitionHeading {
4344 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4345}
4346impl Default for VtolTransitionHeading {
4347 fn default() -> Self {
4348 Self::DEFAULT
4349 }
4350}
4351#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4353#[cfg_attr(feature = "serde", serde(tag = "type"))]
4354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4355#[repr(u32)]
4356#[doc = "WiFi Mode."]
4357pub enum WifiConfigApMode {
4358 #[doc = "WiFi mode is undefined."]
4359 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4360 #[doc = "WiFi configured as an access point."]
4361 WIFI_CONFIG_AP_MODE_AP = 1,
4362 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4363 WIFI_CONFIG_AP_MODE_STATION = 2,
4364 #[doc = "WiFi disabled."]
4365 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4366}
4367impl WifiConfigApMode {
4368 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4369}
4370impl Default for WifiConfigApMode {
4371 fn default() -> Self {
4372 Self::DEFAULT
4373 }
4374}
4375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4377#[cfg_attr(feature = "serde", serde(tag = "type"))]
4378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4379#[repr(u32)]
4380#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4381pub enum WifiConfigApResponse {
4382 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4383 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4384 #[doc = "Changes accepted."]
4385 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4386 #[doc = "Changes rejected."]
4387 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4388 #[doc = "Invalid Mode."]
4389 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4390 #[doc = "Invalid SSID."]
4391 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4392 #[doc = "Invalid Password."]
4393 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4394}
4395impl WifiConfigApResponse {
4396 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4397}
4398impl Default for WifiConfigApResponse {
4399 fn default() -> Self {
4400 Self::DEFAULT
4401 }
4402}
4403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4405#[cfg_attr(feature = "serde", serde(tag = "type"))]
4406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4407#[repr(u32)]
4408#[doc = "Winch actions."]
4409pub enum WinchActions {
4410 #[doc = "Allow motor to freewheel."]
4411 WINCH_RELAXED = 0,
4412 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4413 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4414 #[doc = "Wind or unwind line at specified rate."]
4415 WINCH_RATE_CONTROL = 2,
4416 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4417 WINCH_LOCK = 3,
4418 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4419 WINCH_DELIVER = 4,
4420 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4421 WINCH_HOLD = 5,
4422 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4423 WINCH_RETRACT = 6,
4424 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4425 WINCH_LOAD_LINE = 7,
4426 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4427 WINCH_ABANDON_LINE = 8,
4428 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4429 WINCH_LOAD_PAYLOAD = 9,
4430}
4431impl WinchActions {
4432 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4433}
4434impl Default for WinchActions {
4435 fn default() -> Self {
4436 Self::DEFAULT
4437 }
4438}
4439#[doc = "Set the vehicle attitude and body angular rates."]
4440#[doc = ""]
4441#[doc = "ID: 140"]
4442#[derive(Debug, Clone, PartialEq)]
4443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4445pub struct ACTUATOR_CONTROL_TARGET_DATA {
4446 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4447 pub time_usec: u64,
4448 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4449 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4450 pub controls: [f32; 8],
4451 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4452 pub group_mlx: u8,
4453}
4454impl ACTUATOR_CONTROL_TARGET_DATA {
4455 pub const ENCODED_LEN: usize = 41usize;
4456 pub const DEFAULT: Self = Self {
4457 time_usec: 0_u64,
4458 controls: [0.0_f32; 8usize],
4459 group_mlx: 0_u8,
4460 };
4461 #[cfg(feature = "arbitrary")]
4462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4463 use arbitrary::{Arbitrary, Unstructured};
4464 let mut buf = [0u8; 1024];
4465 rng.fill_bytes(&mut buf);
4466 let mut unstructured = Unstructured::new(&buf);
4467 Self::arbitrary(&mut unstructured).unwrap_or_default()
4468 }
4469}
4470impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4471 fn default() -> Self {
4472 Self::DEFAULT.clone()
4473 }
4474}
4475impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4476 type Message = MavMessage;
4477 const ID: u32 = 140u32;
4478 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4479 const EXTRA_CRC: u8 = 181u8;
4480 const ENCODED_LEN: usize = 41usize;
4481 fn deser(
4482 _version: MavlinkVersion,
4483 __input: &[u8],
4484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4485 let avail_len = __input.len();
4486 let mut payload_buf = [0; Self::ENCODED_LEN];
4487 let mut buf = if avail_len < Self::ENCODED_LEN {
4488 payload_buf[0..avail_len].copy_from_slice(__input);
4489 Bytes::new(&payload_buf)
4490 } else {
4491 Bytes::new(__input)
4492 };
4493 let mut __struct = Self::default();
4494 __struct.time_usec = buf.get_u64_le();
4495 for v in &mut __struct.controls {
4496 let val = buf.get_f32_le();
4497 *v = val;
4498 }
4499 __struct.group_mlx = buf.get_u8();
4500 Ok(__struct)
4501 }
4502 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4503 let mut __tmp = BytesMut::new(bytes);
4504 #[allow(clippy::absurd_extreme_comparisons)]
4505 #[allow(unused_comparisons)]
4506 if __tmp.remaining() < Self::ENCODED_LEN {
4507 panic!(
4508 "buffer is too small (need {} bytes, but got {})",
4509 Self::ENCODED_LEN,
4510 __tmp.remaining(),
4511 )
4512 }
4513 __tmp.put_u64_le(self.time_usec);
4514 for val in &self.controls {
4515 __tmp.put_f32_le(*val);
4516 }
4517 __tmp.put_u8(self.group_mlx);
4518 if matches!(version, MavlinkVersion::V2) {
4519 let len = __tmp.len();
4520 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4521 } else {
4522 __tmp.len()
4523 }
4524 }
4525}
4526#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4527#[doc = ""]
4528#[doc = "ID: 375"]
4529#[derive(Debug, Clone, PartialEq)]
4530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4532pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4533 #[doc = "Timestamp (since system boot)."]
4534 pub time_usec: u64,
4535 #[doc = "Active outputs"]
4536 pub active: u32,
4537 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4538 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4539 pub actuator: [f32; 32],
4540}
4541impl ACTUATOR_OUTPUT_STATUS_DATA {
4542 pub const ENCODED_LEN: usize = 140usize;
4543 pub const DEFAULT: Self = Self {
4544 time_usec: 0_u64,
4545 active: 0_u32,
4546 actuator: [0.0_f32; 32usize],
4547 };
4548 #[cfg(feature = "arbitrary")]
4549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4550 use arbitrary::{Arbitrary, Unstructured};
4551 let mut buf = [0u8; 1024];
4552 rng.fill_bytes(&mut buf);
4553 let mut unstructured = Unstructured::new(&buf);
4554 Self::arbitrary(&mut unstructured).unwrap_or_default()
4555 }
4556}
4557impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4558 fn default() -> Self {
4559 Self::DEFAULT.clone()
4560 }
4561}
4562impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4563 type Message = MavMessage;
4564 const ID: u32 = 375u32;
4565 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4566 const EXTRA_CRC: u8 = 251u8;
4567 const ENCODED_LEN: usize = 140usize;
4568 fn deser(
4569 _version: MavlinkVersion,
4570 __input: &[u8],
4571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4572 let avail_len = __input.len();
4573 let mut payload_buf = [0; Self::ENCODED_LEN];
4574 let mut buf = if avail_len < Self::ENCODED_LEN {
4575 payload_buf[0..avail_len].copy_from_slice(__input);
4576 Bytes::new(&payload_buf)
4577 } else {
4578 Bytes::new(__input)
4579 };
4580 let mut __struct = Self::default();
4581 __struct.time_usec = buf.get_u64_le();
4582 __struct.active = buf.get_u32_le();
4583 for v in &mut __struct.actuator {
4584 let val = buf.get_f32_le();
4585 *v = val;
4586 }
4587 Ok(__struct)
4588 }
4589 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4590 let mut __tmp = BytesMut::new(bytes);
4591 #[allow(clippy::absurd_extreme_comparisons)]
4592 #[allow(unused_comparisons)]
4593 if __tmp.remaining() < Self::ENCODED_LEN {
4594 panic!(
4595 "buffer is too small (need {} bytes, but got {})",
4596 Self::ENCODED_LEN,
4597 __tmp.remaining(),
4598 )
4599 }
4600 __tmp.put_u64_le(self.time_usec);
4601 __tmp.put_u32_le(self.active);
4602 for val in &self.actuator {
4603 __tmp.put_f32_le(*val);
4604 }
4605 if matches!(version, MavlinkVersion::V2) {
4606 let len = __tmp.len();
4607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4608 } else {
4609 __tmp.len()
4610 }
4611 }
4612}
4613#[doc = "The location and information of an ADSB vehicle."]
4614#[doc = ""]
4615#[doc = "ID: 246"]
4616#[derive(Debug, Clone, PartialEq)]
4617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4619pub struct ADSB_VEHICLE_DATA {
4620 #[doc = "ICAO address"]
4621 pub ICAO_address: u32,
4622 #[doc = "Latitude"]
4623 pub lat: i32,
4624 #[doc = "Longitude"]
4625 pub lon: i32,
4626 #[doc = "Altitude(ASL)"]
4627 pub altitude: i32,
4628 #[doc = "Course over ground"]
4629 pub heading: u16,
4630 #[doc = "The horizontal velocity"]
4631 pub hor_velocity: u16,
4632 #[doc = "The vertical velocity. Positive is up"]
4633 pub ver_velocity: i16,
4634 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4635 pub flags: AdsbFlags,
4636 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4637 pub squawk: u16,
4638 #[doc = "ADSB altitude type."]
4639 pub altitude_type: AdsbAltitudeType,
4640 #[doc = "The callsign, 8+null"]
4641 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4642 pub callsign: [u8; 9],
4643 #[doc = "ADSB emitter type."]
4644 pub emitter_type: AdsbEmitterType,
4645 #[doc = "Time since last communication in seconds"]
4646 pub tslc: u8,
4647}
4648impl ADSB_VEHICLE_DATA {
4649 pub const ENCODED_LEN: usize = 38usize;
4650 pub const DEFAULT: Self = Self {
4651 ICAO_address: 0_u32,
4652 lat: 0_i32,
4653 lon: 0_i32,
4654 altitude: 0_i32,
4655 heading: 0_u16,
4656 hor_velocity: 0_u16,
4657 ver_velocity: 0_i16,
4658 flags: AdsbFlags::DEFAULT,
4659 squawk: 0_u16,
4660 altitude_type: AdsbAltitudeType::DEFAULT,
4661 callsign: [0_u8; 9usize],
4662 emitter_type: AdsbEmitterType::DEFAULT,
4663 tslc: 0_u8,
4664 };
4665 #[cfg(feature = "arbitrary")]
4666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4667 use arbitrary::{Arbitrary, Unstructured};
4668 let mut buf = [0u8; 1024];
4669 rng.fill_bytes(&mut buf);
4670 let mut unstructured = Unstructured::new(&buf);
4671 Self::arbitrary(&mut unstructured).unwrap_or_default()
4672 }
4673}
4674impl Default for ADSB_VEHICLE_DATA {
4675 fn default() -> Self {
4676 Self::DEFAULT.clone()
4677 }
4678}
4679impl MessageData for ADSB_VEHICLE_DATA {
4680 type Message = MavMessage;
4681 const ID: u32 = 246u32;
4682 const NAME: &'static str = "ADSB_VEHICLE";
4683 const EXTRA_CRC: u8 = 184u8;
4684 const ENCODED_LEN: usize = 38usize;
4685 fn deser(
4686 _version: MavlinkVersion,
4687 __input: &[u8],
4688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4689 let avail_len = __input.len();
4690 let mut payload_buf = [0; Self::ENCODED_LEN];
4691 let mut buf = if avail_len < Self::ENCODED_LEN {
4692 payload_buf[0..avail_len].copy_from_slice(__input);
4693 Bytes::new(&payload_buf)
4694 } else {
4695 Bytes::new(__input)
4696 };
4697 let mut __struct = Self::default();
4698 __struct.ICAO_address = buf.get_u32_le();
4699 __struct.lat = buf.get_i32_le();
4700 __struct.lon = buf.get_i32_le();
4701 __struct.altitude = buf.get_i32_le();
4702 __struct.heading = buf.get_u16_le();
4703 __struct.hor_velocity = buf.get_u16_le();
4704 __struct.ver_velocity = buf.get_i16_le();
4705 let tmp = buf.get_u16_le();
4706 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4707 ::mavlink_core::error::ParserError::InvalidFlag {
4708 flag_type: "AdsbFlags",
4709 value: tmp as u32,
4710 },
4711 )?;
4712 __struct.squawk = buf.get_u16_le();
4713 let tmp = buf.get_u8();
4714 __struct.altitude_type =
4715 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4716 enum_type: "AdsbAltitudeType",
4717 value: tmp as u32,
4718 })?;
4719 for v in &mut __struct.callsign {
4720 let val = buf.get_u8();
4721 *v = val;
4722 }
4723 let tmp = buf.get_u8();
4724 __struct.emitter_type =
4725 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4726 enum_type: "AdsbEmitterType",
4727 value: tmp as u32,
4728 })?;
4729 __struct.tslc = buf.get_u8();
4730 Ok(__struct)
4731 }
4732 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4733 let mut __tmp = BytesMut::new(bytes);
4734 #[allow(clippy::absurd_extreme_comparisons)]
4735 #[allow(unused_comparisons)]
4736 if __tmp.remaining() < Self::ENCODED_LEN {
4737 panic!(
4738 "buffer is too small (need {} bytes, but got {})",
4739 Self::ENCODED_LEN,
4740 __tmp.remaining(),
4741 )
4742 }
4743 __tmp.put_u32_le(self.ICAO_address);
4744 __tmp.put_i32_le(self.lat);
4745 __tmp.put_i32_le(self.lon);
4746 __tmp.put_i32_le(self.altitude);
4747 __tmp.put_u16_le(self.heading);
4748 __tmp.put_u16_le(self.hor_velocity);
4749 __tmp.put_i16_le(self.ver_velocity);
4750 __tmp.put_u16_le(self.flags.bits());
4751 __tmp.put_u16_le(self.squawk);
4752 __tmp.put_u8(self.altitude_type as u8);
4753 for val in &self.callsign {
4754 __tmp.put_u8(*val);
4755 }
4756 __tmp.put_u8(self.emitter_type as u8);
4757 __tmp.put_u8(self.tslc);
4758 if matches!(version, MavlinkVersion::V2) {
4759 let len = __tmp.len();
4760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4761 } else {
4762 __tmp.len()
4763 }
4764 }
4765}
4766#[doc = "The location and information of an AIS vessel."]
4767#[doc = ""]
4768#[doc = "ID: 301"]
4769#[derive(Debug, Clone, PartialEq)]
4770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4772pub struct AIS_VESSEL_DATA {
4773 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4774 pub MMSI: u32,
4775 #[doc = "Latitude"]
4776 pub lat: i32,
4777 #[doc = "Longitude"]
4778 pub lon: i32,
4779 #[doc = "Course over ground"]
4780 pub COG: u16,
4781 #[doc = "True heading"]
4782 pub heading: u16,
4783 #[doc = "Speed over ground"]
4784 pub velocity: u16,
4785 #[doc = "Distance from lat/lon location to bow"]
4786 pub dimension_bow: u16,
4787 #[doc = "Distance from lat/lon location to stern"]
4788 pub dimension_stern: u16,
4789 #[doc = "Time since last communication in seconds"]
4790 pub tslc: u16,
4791 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4792 pub flags: AisFlags,
4793 #[doc = "Turn rate"]
4794 pub turn_rate: i8,
4795 #[doc = "Navigational status"]
4796 pub navigational_status: AisNavStatus,
4797 #[doc = "Type of vessels"]
4798 pub mavtype: AisType,
4799 #[doc = "Distance from lat/lon location to port side"]
4800 pub dimension_port: u8,
4801 #[doc = "Distance from lat/lon location to starboard side"]
4802 pub dimension_starboard: u8,
4803 #[doc = "The vessel callsign"]
4804 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4805 pub callsign: [u8; 7],
4806 #[doc = "The vessel name"]
4807 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4808 pub name: [u8; 20],
4809}
4810impl AIS_VESSEL_DATA {
4811 pub const ENCODED_LEN: usize = 58usize;
4812 pub const DEFAULT: Self = Self {
4813 MMSI: 0_u32,
4814 lat: 0_i32,
4815 lon: 0_i32,
4816 COG: 0_u16,
4817 heading: 0_u16,
4818 velocity: 0_u16,
4819 dimension_bow: 0_u16,
4820 dimension_stern: 0_u16,
4821 tslc: 0_u16,
4822 flags: AisFlags::DEFAULT,
4823 turn_rate: 0_i8,
4824 navigational_status: AisNavStatus::DEFAULT,
4825 mavtype: AisType::DEFAULT,
4826 dimension_port: 0_u8,
4827 dimension_starboard: 0_u8,
4828 callsign: [0_u8; 7usize],
4829 name: [0_u8; 20usize],
4830 };
4831 #[cfg(feature = "arbitrary")]
4832 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4833 use arbitrary::{Arbitrary, Unstructured};
4834 let mut buf = [0u8; 1024];
4835 rng.fill_bytes(&mut buf);
4836 let mut unstructured = Unstructured::new(&buf);
4837 Self::arbitrary(&mut unstructured).unwrap_or_default()
4838 }
4839}
4840impl Default for AIS_VESSEL_DATA {
4841 fn default() -> Self {
4842 Self::DEFAULT.clone()
4843 }
4844}
4845impl MessageData for AIS_VESSEL_DATA {
4846 type Message = MavMessage;
4847 const ID: u32 = 301u32;
4848 const NAME: &'static str = "AIS_VESSEL";
4849 const EXTRA_CRC: u8 = 243u8;
4850 const ENCODED_LEN: usize = 58usize;
4851 fn deser(
4852 _version: MavlinkVersion,
4853 __input: &[u8],
4854 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4855 let avail_len = __input.len();
4856 let mut payload_buf = [0; Self::ENCODED_LEN];
4857 let mut buf = if avail_len < Self::ENCODED_LEN {
4858 payload_buf[0..avail_len].copy_from_slice(__input);
4859 Bytes::new(&payload_buf)
4860 } else {
4861 Bytes::new(__input)
4862 };
4863 let mut __struct = Self::default();
4864 __struct.MMSI = buf.get_u32_le();
4865 __struct.lat = buf.get_i32_le();
4866 __struct.lon = buf.get_i32_le();
4867 __struct.COG = buf.get_u16_le();
4868 __struct.heading = buf.get_u16_le();
4869 __struct.velocity = buf.get_u16_le();
4870 __struct.dimension_bow = buf.get_u16_le();
4871 __struct.dimension_stern = buf.get_u16_le();
4872 __struct.tslc = buf.get_u16_le();
4873 let tmp = buf.get_u16_le();
4874 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4875 ::mavlink_core::error::ParserError::InvalidFlag {
4876 flag_type: "AisFlags",
4877 value: tmp as u32,
4878 },
4879 )?;
4880 __struct.turn_rate = buf.get_i8();
4881 let tmp = buf.get_u8();
4882 __struct.navigational_status =
4883 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4884 enum_type: "AisNavStatus",
4885 value: tmp as u32,
4886 })?;
4887 let tmp = buf.get_u8();
4888 __struct.mavtype =
4889 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4890 enum_type: "AisType",
4891 value: tmp as u32,
4892 })?;
4893 __struct.dimension_port = buf.get_u8();
4894 __struct.dimension_starboard = buf.get_u8();
4895 for v in &mut __struct.callsign {
4896 let val = buf.get_u8();
4897 *v = val;
4898 }
4899 for v in &mut __struct.name {
4900 let val = buf.get_u8();
4901 *v = val;
4902 }
4903 Ok(__struct)
4904 }
4905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4906 let mut __tmp = BytesMut::new(bytes);
4907 #[allow(clippy::absurd_extreme_comparisons)]
4908 #[allow(unused_comparisons)]
4909 if __tmp.remaining() < Self::ENCODED_LEN {
4910 panic!(
4911 "buffer is too small (need {} bytes, but got {})",
4912 Self::ENCODED_LEN,
4913 __tmp.remaining(),
4914 )
4915 }
4916 __tmp.put_u32_le(self.MMSI);
4917 __tmp.put_i32_le(self.lat);
4918 __tmp.put_i32_le(self.lon);
4919 __tmp.put_u16_le(self.COG);
4920 __tmp.put_u16_le(self.heading);
4921 __tmp.put_u16_le(self.velocity);
4922 __tmp.put_u16_le(self.dimension_bow);
4923 __tmp.put_u16_le(self.dimension_stern);
4924 __tmp.put_u16_le(self.tslc);
4925 __tmp.put_u16_le(self.flags.bits());
4926 __tmp.put_i8(self.turn_rate);
4927 __tmp.put_u8(self.navigational_status as u8);
4928 __tmp.put_u8(self.mavtype as u8);
4929 __tmp.put_u8(self.dimension_port);
4930 __tmp.put_u8(self.dimension_starboard);
4931 for val in &self.callsign {
4932 __tmp.put_u8(*val);
4933 }
4934 for val in &self.name {
4935 __tmp.put_u8(*val);
4936 }
4937 if matches!(version, MavlinkVersion::V2) {
4938 let len = __tmp.len();
4939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4940 } else {
4941 __tmp.len()
4942 }
4943 }
4944}
4945#[doc = "The current system altitude."]
4946#[doc = ""]
4947#[doc = "ID: 141"]
4948#[derive(Debug, Clone, PartialEq)]
4949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4951pub struct ALTITUDE_DATA {
4952 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4953 pub time_usec: u64,
4954 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
4955 pub altitude_monotonic: f32,
4956 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
4957 pub altitude_amsl: f32,
4958 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
4959 pub altitude_local: f32,
4960 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
4961 pub altitude_relative: f32,
4962 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
4963 pub altitude_terrain: f32,
4964 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
4965 pub bottom_clearance: f32,
4966}
4967impl ALTITUDE_DATA {
4968 pub const ENCODED_LEN: usize = 32usize;
4969 pub const DEFAULT: Self = Self {
4970 time_usec: 0_u64,
4971 altitude_monotonic: 0.0_f32,
4972 altitude_amsl: 0.0_f32,
4973 altitude_local: 0.0_f32,
4974 altitude_relative: 0.0_f32,
4975 altitude_terrain: 0.0_f32,
4976 bottom_clearance: 0.0_f32,
4977 };
4978 #[cfg(feature = "arbitrary")]
4979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4980 use arbitrary::{Arbitrary, Unstructured};
4981 let mut buf = [0u8; 1024];
4982 rng.fill_bytes(&mut buf);
4983 let mut unstructured = Unstructured::new(&buf);
4984 Self::arbitrary(&mut unstructured).unwrap_or_default()
4985 }
4986}
4987impl Default for ALTITUDE_DATA {
4988 fn default() -> Self {
4989 Self::DEFAULT.clone()
4990 }
4991}
4992impl MessageData for ALTITUDE_DATA {
4993 type Message = MavMessage;
4994 const ID: u32 = 141u32;
4995 const NAME: &'static str = "ALTITUDE";
4996 const EXTRA_CRC: u8 = 47u8;
4997 const ENCODED_LEN: usize = 32usize;
4998 fn deser(
4999 _version: MavlinkVersion,
5000 __input: &[u8],
5001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5002 let avail_len = __input.len();
5003 let mut payload_buf = [0; Self::ENCODED_LEN];
5004 let mut buf = if avail_len < Self::ENCODED_LEN {
5005 payload_buf[0..avail_len].copy_from_slice(__input);
5006 Bytes::new(&payload_buf)
5007 } else {
5008 Bytes::new(__input)
5009 };
5010 let mut __struct = Self::default();
5011 __struct.time_usec = buf.get_u64_le();
5012 __struct.altitude_monotonic = buf.get_f32_le();
5013 __struct.altitude_amsl = buf.get_f32_le();
5014 __struct.altitude_local = buf.get_f32_le();
5015 __struct.altitude_relative = buf.get_f32_le();
5016 __struct.altitude_terrain = buf.get_f32_le();
5017 __struct.bottom_clearance = buf.get_f32_le();
5018 Ok(__struct)
5019 }
5020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5021 let mut __tmp = BytesMut::new(bytes);
5022 #[allow(clippy::absurd_extreme_comparisons)]
5023 #[allow(unused_comparisons)]
5024 if __tmp.remaining() < Self::ENCODED_LEN {
5025 panic!(
5026 "buffer is too small (need {} bytes, but got {})",
5027 Self::ENCODED_LEN,
5028 __tmp.remaining(),
5029 )
5030 }
5031 __tmp.put_u64_le(self.time_usec);
5032 __tmp.put_f32_le(self.altitude_monotonic);
5033 __tmp.put_f32_le(self.altitude_amsl);
5034 __tmp.put_f32_le(self.altitude_local);
5035 __tmp.put_f32_le(self.altitude_relative);
5036 __tmp.put_f32_le(self.altitude_terrain);
5037 __tmp.put_f32_le(self.bottom_clearance);
5038 if matches!(version, MavlinkVersion::V2) {
5039 let len = __tmp.len();
5040 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5041 } else {
5042 __tmp.len()
5043 }
5044 }
5045}
5046#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5047#[doc = ""]
5048#[doc = "ID: 30"]
5049#[derive(Debug, Clone, PartialEq)]
5050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5052pub struct ATTITUDE_DATA {
5053 #[doc = "Timestamp (time since system boot)."]
5054 pub time_boot_ms: u32,
5055 #[doc = "Roll angle (-pi..+pi)"]
5056 pub roll: f32,
5057 #[doc = "Pitch angle (-pi..+pi)"]
5058 pub pitch: f32,
5059 #[doc = "Yaw angle (-pi..+pi)"]
5060 pub yaw: f32,
5061 #[doc = "Roll angular speed"]
5062 pub rollspeed: f32,
5063 #[doc = "Pitch angular speed"]
5064 pub pitchspeed: f32,
5065 #[doc = "Yaw angular speed"]
5066 pub yawspeed: f32,
5067}
5068impl ATTITUDE_DATA {
5069 pub const ENCODED_LEN: usize = 28usize;
5070 pub const DEFAULT: Self = Self {
5071 time_boot_ms: 0_u32,
5072 roll: 0.0_f32,
5073 pitch: 0.0_f32,
5074 yaw: 0.0_f32,
5075 rollspeed: 0.0_f32,
5076 pitchspeed: 0.0_f32,
5077 yawspeed: 0.0_f32,
5078 };
5079 #[cfg(feature = "arbitrary")]
5080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5081 use arbitrary::{Arbitrary, Unstructured};
5082 let mut buf = [0u8; 1024];
5083 rng.fill_bytes(&mut buf);
5084 let mut unstructured = Unstructured::new(&buf);
5085 Self::arbitrary(&mut unstructured).unwrap_or_default()
5086 }
5087}
5088impl Default for ATTITUDE_DATA {
5089 fn default() -> Self {
5090 Self::DEFAULT.clone()
5091 }
5092}
5093impl MessageData for ATTITUDE_DATA {
5094 type Message = MavMessage;
5095 const ID: u32 = 30u32;
5096 const NAME: &'static str = "ATTITUDE";
5097 const EXTRA_CRC: u8 = 39u8;
5098 const ENCODED_LEN: usize = 28usize;
5099 fn deser(
5100 _version: MavlinkVersion,
5101 __input: &[u8],
5102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5103 let avail_len = __input.len();
5104 let mut payload_buf = [0; Self::ENCODED_LEN];
5105 let mut buf = if avail_len < Self::ENCODED_LEN {
5106 payload_buf[0..avail_len].copy_from_slice(__input);
5107 Bytes::new(&payload_buf)
5108 } else {
5109 Bytes::new(__input)
5110 };
5111 let mut __struct = Self::default();
5112 __struct.time_boot_ms = buf.get_u32_le();
5113 __struct.roll = buf.get_f32_le();
5114 __struct.pitch = buf.get_f32_le();
5115 __struct.yaw = buf.get_f32_le();
5116 __struct.rollspeed = buf.get_f32_le();
5117 __struct.pitchspeed = buf.get_f32_le();
5118 __struct.yawspeed = buf.get_f32_le();
5119 Ok(__struct)
5120 }
5121 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5122 let mut __tmp = BytesMut::new(bytes);
5123 #[allow(clippy::absurd_extreme_comparisons)]
5124 #[allow(unused_comparisons)]
5125 if __tmp.remaining() < Self::ENCODED_LEN {
5126 panic!(
5127 "buffer is too small (need {} bytes, but got {})",
5128 Self::ENCODED_LEN,
5129 __tmp.remaining(),
5130 )
5131 }
5132 __tmp.put_u32_le(self.time_boot_ms);
5133 __tmp.put_f32_le(self.roll);
5134 __tmp.put_f32_le(self.pitch);
5135 __tmp.put_f32_le(self.yaw);
5136 __tmp.put_f32_le(self.rollspeed);
5137 __tmp.put_f32_le(self.pitchspeed);
5138 __tmp.put_f32_le(self.yawspeed);
5139 if matches!(version, MavlinkVersion::V2) {
5140 let len = __tmp.len();
5141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5142 } else {
5143 __tmp.len()
5144 }
5145 }
5146}
5147#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5148#[doc = ""]
5149#[doc = "ID: 31"]
5150#[derive(Debug, Clone, PartialEq)]
5151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5152#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5153pub struct ATTITUDE_QUATERNION_DATA {
5154 #[doc = "Timestamp (time since system boot)."]
5155 pub time_boot_ms: u32,
5156 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5157 pub q1: f32,
5158 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5159 pub q2: f32,
5160 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5161 pub q3: f32,
5162 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5163 pub q4: f32,
5164 #[doc = "Roll angular speed"]
5165 pub rollspeed: f32,
5166 #[doc = "Pitch angular speed"]
5167 pub pitchspeed: f32,
5168 #[doc = "Yaw angular speed"]
5169 pub yawspeed: f32,
5170 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5171 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5172 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5173 pub repr_offset_q: [f32; 4],
5174}
5175impl ATTITUDE_QUATERNION_DATA {
5176 pub const ENCODED_LEN: usize = 48usize;
5177 pub const DEFAULT: Self = Self {
5178 time_boot_ms: 0_u32,
5179 q1: 0.0_f32,
5180 q2: 0.0_f32,
5181 q3: 0.0_f32,
5182 q4: 0.0_f32,
5183 rollspeed: 0.0_f32,
5184 pitchspeed: 0.0_f32,
5185 yawspeed: 0.0_f32,
5186 repr_offset_q: [0.0_f32; 4usize],
5187 };
5188 #[cfg(feature = "arbitrary")]
5189 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5190 use arbitrary::{Arbitrary, Unstructured};
5191 let mut buf = [0u8; 1024];
5192 rng.fill_bytes(&mut buf);
5193 let mut unstructured = Unstructured::new(&buf);
5194 Self::arbitrary(&mut unstructured).unwrap_or_default()
5195 }
5196}
5197impl Default for ATTITUDE_QUATERNION_DATA {
5198 fn default() -> Self {
5199 Self::DEFAULT.clone()
5200 }
5201}
5202impl MessageData for ATTITUDE_QUATERNION_DATA {
5203 type Message = MavMessage;
5204 const ID: u32 = 31u32;
5205 const NAME: &'static str = "ATTITUDE_QUATERNION";
5206 const EXTRA_CRC: u8 = 246u8;
5207 const ENCODED_LEN: usize = 48usize;
5208 fn deser(
5209 _version: MavlinkVersion,
5210 __input: &[u8],
5211 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5212 let avail_len = __input.len();
5213 let mut payload_buf = [0; Self::ENCODED_LEN];
5214 let mut buf = if avail_len < Self::ENCODED_LEN {
5215 payload_buf[0..avail_len].copy_from_slice(__input);
5216 Bytes::new(&payload_buf)
5217 } else {
5218 Bytes::new(__input)
5219 };
5220 let mut __struct = Self::default();
5221 __struct.time_boot_ms = buf.get_u32_le();
5222 __struct.q1 = buf.get_f32_le();
5223 __struct.q2 = buf.get_f32_le();
5224 __struct.q3 = buf.get_f32_le();
5225 __struct.q4 = buf.get_f32_le();
5226 __struct.rollspeed = buf.get_f32_le();
5227 __struct.pitchspeed = buf.get_f32_le();
5228 __struct.yawspeed = buf.get_f32_le();
5229 for v in &mut __struct.repr_offset_q {
5230 let val = buf.get_f32_le();
5231 *v = val;
5232 }
5233 Ok(__struct)
5234 }
5235 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5236 let mut __tmp = BytesMut::new(bytes);
5237 #[allow(clippy::absurd_extreme_comparisons)]
5238 #[allow(unused_comparisons)]
5239 if __tmp.remaining() < Self::ENCODED_LEN {
5240 panic!(
5241 "buffer is too small (need {} bytes, but got {})",
5242 Self::ENCODED_LEN,
5243 __tmp.remaining(),
5244 )
5245 }
5246 __tmp.put_u32_le(self.time_boot_ms);
5247 __tmp.put_f32_le(self.q1);
5248 __tmp.put_f32_le(self.q2);
5249 __tmp.put_f32_le(self.q3);
5250 __tmp.put_f32_le(self.q4);
5251 __tmp.put_f32_le(self.rollspeed);
5252 __tmp.put_f32_le(self.pitchspeed);
5253 __tmp.put_f32_le(self.yawspeed);
5254 if matches!(version, MavlinkVersion::V2) {
5255 for val in &self.repr_offset_q {
5256 __tmp.put_f32_le(*val);
5257 }
5258 let len = __tmp.len();
5259 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5260 } else {
5261 __tmp.len()
5262 }
5263 }
5264}
5265#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5266#[doc = ""]
5267#[doc = "ID: 61"]
5268#[derive(Debug, Clone, PartialEq)]
5269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5271pub struct ATTITUDE_QUATERNION_COV_DATA {
5272 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5273 pub time_usec: u64,
5274 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5275 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5276 pub q: [f32; 4],
5277 #[doc = "Roll angular speed"]
5278 pub rollspeed: f32,
5279 #[doc = "Pitch angular speed"]
5280 pub pitchspeed: f32,
5281 #[doc = "Yaw angular speed"]
5282 pub yawspeed: f32,
5283 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5284 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5285 pub covariance: [f32; 9],
5286}
5287impl ATTITUDE_QUATERNION_COV_DATA {
5288 pub const ENCODED_LEN: usize = 72usize;
5289 pub const DEFAULT: Self = Self {
5290 time_usec: 0_u64,
5291 q: [0.0_f32; 4usize],
5292 rollspeed: 0.0_f32,
5293 pitchspeed: 0.0_f32,
5294 yawspeed: 0.0_f32,
5295 covariance: [0.0_f32; 9usize],
5296 };
5297 #[cfg(feature = "arbitrary")]
5298 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5299 use arbitrary::{Arbitrary, Unstructured};
5300 let mut buf = [0u8; 1024];
5301 rng.fill_bytes(&mut buf);
5302 let mut unstructured = Unstructured::new(&buf);
5303 Self::arbitrary(&mut unstructured).unwrap_or_default()
5304 }
5305}
5306impl Default for ATTITUDE_QUATERNION_COV_DATA {
5307 fn default() -> Self {
5308 Self::DEFAULT.clone()
5309 }
5310}
5311impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5312 type Message = MavMessage;
5313 const ID: u32 = 61u32;
5314 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5315 const EXTRA_CRC: u8 = 167u8;
5316 const ENCODED_LEN: usize = 72usize;
5317 fn deser(
5318 _version: MavlinkVersion,
5319 __input: &[u8],
5320 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5321 let avail_len = __input.len();
5322 let mut payload_buf = [0; Self::ENCODED_LEN];
5323 let mut buf = if avail_len < Self::ENCODED_LEN {
5324 payload_buf[0..avail_len].copy_from_slice(__input);
5325 Bytes::new(&payload_buf)
5326 } else {
5327 Bytes::new(__input)
5328 };
5329 let mut __struct = Self::default();
5330 __struct.time_usec = buf.get_u64_le();
5331 for v in &mut __struct.q {
5332 let val = buf.get_f32_le();
5333 *v = val;
5334 }
5335 __struct.rollspeed = buf.get_f32_le();
5336 __struct.pitchspeed = buf.get_f32_le();
5337 __struct.yawspeed = buf.get_f32_le();
5338 for v in &mut __struct.covariance {
5339 let val = buf.get_f32_le();
5340 *v = val;
5341 }
5342 Ok(__struct)
5343 }
5344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5345 let mut __tmp = BytesMut::new(bytes);
5346 #[allow(clippy::absurd_extreme_comparisons)]
5347 #[allow(unused_comparisons)]
5348 if __tmp.remaining() < Self::ENCODED_LEN {
5349 panic!(
5350 "buffer is too small (need {} bytes, but got {})",
5351 Self::ENCODED_LEN,
5352 __tmp.remaining(),
5353 )
5354 }
5355 __tmp.put_u64_le(self.time_usec);
5356 for val in &self.q {
5357 __tmp.put_f32_le(*val);
5358 }
5359 __tmp.put_f32_le(self.rollspeed);
5360 __tmp.put_f32_le(self.pitchspeed);
5361 __tmp.put_f32_le(self.yawspeed);
5362 for val in &self.covariance {
5363 __tmp.put_f32_le(*val);
5364 }
5365 if matches!(version, MavlinkVersion::V2) {
5366 let len = __tmp.len();
5367 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5368 } else {
5369 __tmp.len()
5370 }
5371 }
5372}
5373#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5374#[doc = ""]
5375#[doc = "ID: 83"]
5376#[derive(Debug, Clone, PartialEq)]
5377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5379pub struct ATTITUDE_TARGET_DATA {
5380 #[doc = "Timestamp (time since system boot)."]
5381 pub time_boot_ms: u32,
5382 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5383 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5384 pub q: [f32; 4],
5385 #[doc = "Body roll rate"]
5386 pub body_roll_rate: f32,
5387 #[doc = "Body pitch rate"]
5388 pub body_pitch_rate: f32,
5389 #[doc = "Body yaw rate"]
5390 pub body_yaw_rate: f32,
5391 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5392 pub thrust: f32,
5393 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5394 pub type_mask: AttitudeTargetTypemask,
5395}
5396impl ATTITUDE_TARGET_DATA {
5397 pub const ENCODED_LEN: usize = 37usize;
5398 pub const DEFAULT: Self = Self {
5399 time_boot_ms: 0_u32,
5400 q: [0.0_f32; 4usize],
5401 body_roll_rate: 0.0_f32,
5402 body_pitch_rate: 0.0_f32,
5403 body_yaw_rate: 0.0_f32,
5404 thrust: 0.0_f32,
5405 type_mask: AttitudeTargetTypemask::DEFAULT,
5406 };
5407 #[cfg(feature = "arbitrary")]
5408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5409 use arbitrary::{Arbitrary, Unstructured};
5410 let mut buf = [0u8; 1024];
5411 rng.fill_bytes(&mut buf);
5412 let mut unstructured = Unstructured::new(&buf);
5413 Self::arbitrary(&mut unstructured).unwrap_or_default()
5414 }
5415}
5416impl Default for ATTITUDE_TARGET_DATA {
5417 fn default() -> Self {
5418 Self::DEFAULT.clone()
5419 }
5420}
5421impl MessageData for ATTITUDE_TARGET_DATA {
5422 type Message = MavMessage;
5423 const ID: u32 = 83u32;
5424 const NAME: &'static str = "ATTITUDE_TARGET";
5425 const EXTRA_CRC: u8 = 22u8;
5426 const ENCODED_LEN: usize = 37usize;
5427 fn deser(
5428 _version: MavlinkVersion,
5429 __input: &[u8],
5430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5431 let avail_len = __input.len();
5432 let mut payload_buf = [0; Self::ENCODED_LEN];
5433 let mut buf = if avail_len < Self::ENCODED_LEN {
5434 payload_buf[0..avail_len].copy_from_slice(__input);
5435 Bytes::new(&payload_buf)
5436 } else {
5437 Bytes::new(__input)
5438 };
5439 let mut __struct = Self::default();
5440 __struct.time_boot_ms = buf.get_u32_le();
5441 for v in &mut __struct.q {
5442 let val = buf.get_f32_le();
5443 *v = val;
5444 }
5445 __struct.body_roll_rate = buf.get_f32_le();
5446 __struct.body_pitch_rate = buf.get_f32_le();
5447 __struct.body_yaw_rate = buf.get_f32_le();
5448 __struct.thrust = buf.get_f32_le();
5449 let tmp = buf.get_u8();
5450 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5451 tmp & AttitudeTargetTypemask::all().bits(),
5452 )
5453 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5454 flag_type: "AttitudeTargetTypemask",
5455 value: tmp as u32,
5456 })?;
5457 Ok(__struct)
5458 }
5459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5460 let mut __tmp = BytesMut::new(bytes);
5461 #[allow(clippy::absurd_extreme_comparisons)]
5462 #[allow(unused_comparisons)]
5463 if __tmp.remaining() < Self::ENCODED_LEN {
5464 panic!(
5465 "buffer is too small (need {} bytes, but got {})",
5466 Self::ENCODED_LEN,
5467 __tmp.remaining(),
5468 )
5469 }
5470 __tmp.put_u32_le(self.time_boot_ms);
5471 for val in &self.q {
5472 __tmp.put_f32_le(*val);
5473 }
5474 __tmp.put_f32_le(self.body_roll_rate);
5475 __tmp.put_f32_le(self.body_pitch_rate);
5476 __tmp.put_f32_le(self.body_yaw_rate);
5477 __tmp.put_f32_le(self.thrust);
5478 __tmp.put_u8(self.type_mask.bits());
5479 if matches!(version, MavlinkVersion::V2) {
5480 let len = __tmp.len();
5481 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5482 } else {
5483 __tmp.len()
5484 }
5485 }
5486}
5487#[doc = "Motion capture attitude and position."]
5488#[doc = ""]
5489#[doc = "ID: 138"]
5490#[derive(Debug, Clone, PartialEq)]
5491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5493pub struct ATT_POS_MOCAP_DATA {
5494 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5495 pub time_usec: u64,
5496 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5497 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5498 pub q: [f32; 4],
5499 #[doc = "X position (NED)"]
5500 pub x: f32,
5501 #[doc = "Y position (NED)"]
5502 pub y: f32,
5503 #[doc = "Z position (NED)"]
5504 pub z: f32,
5505 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5506 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5507 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5508 pub covariance: [f32; 21],
5509}
5510impl ATT_POS_MOCAP_DATA {
5511 pub const ENCODED_LEN: usize = 120usize;
5512 pub const DEFAULT: Self = Self {
5513 time_usec: 0_u64,
5514 q: [0.0_f32; 4usize],
5515 x: 0.0_f32,
5516 y: 0.0_f32,
5517 z: 0.0_f32,
5518 covariance: [0.0_f32; 21usize],
5519 };
5520 #[cfg(feature = "arbitrary")]
5521 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5522 use arbitrary::{Arbitrary, Unstructured};
5523 let mut buf = [0u8; 1024];
5524 rng.fill_bytes(&mut buf);
5525 let mut unstructured = Unstructured::new(&buf);
5526 Self::arbitrary(&mut unstructured).unwrap_or_default()
5527 }
5528}
5529impl Default for ATT_POS_MOCAP_DATA {
5530 fn default() -> Self {
5531 Self::DEFAULT.clone()
5532 }
5533}
5534impl MessageData for ATT_POS_MOCAP_DATA {
5535 type Message = MavMessage;
5536 const ID: u32 = 138u32;
5537 const NAME: &'static str = "ATT_POS_MOCAP";
5538 const EXTRA_CRC: u8 = 109u8;
5539 const ENCODED_LEN: usize = 120usize;
5540 fn deser(
5541 _version: MavlinkVersion,
5542 __input: &[u8],
5543 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5544 let avail_len = __input.len();
5545 let mut payload_buf = [0; Self::ENCODED_LEN];
5546 let mut buf = if avail_len < Self::ENCODED_LEN {
5547 payload_buf[0..avail_len].copy_from_slice(__input);
5548 Bytes::new(&payload_buf)
5549 } else {
5550 Bytes::new(__input)
5551 };
5552 let mut __struct = Self::default();
5553 __struct.time_usec = buf.get_u64_le();
5554 for v in &mut __struct.q {
5555 let val = buf.get_f32_le();
5556 *v = val;
5557 }
5558 __struct.x = buf.get_f32_le();
5559 __struct.y = buf.get_f32_le();
5560 __struct.z = buf.get_f32_le();
5561 for v in &mut __struct.covariance {
5562 let val = buf.get_f32_le();
5563 *v = val;
5564 }
5565 Ok(__struct)
5566 }
5567 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5568 let mut __tmp = BytesMut::new(bytes);
5569 #[allow(clippy::absurd_extreme_comparisons)]
5570 #[allow(unused_comparisons)]
5571 if __tmp.remaining() < Self::ENCODED_LEN {
5572 panic!(
5573 "buffer is too small (need {} bytes, but got {})",
5574 Self::ENCODED_LEN,
5575 __tmp.remaining(),
5576 )
5577 }
5578 __tmp.put_u64_le(self.time_usec);
5579 for val in &self.q {
5580 __tmp.put_f32_le(*val);
5581 }
5582 __tmp.put_f32_le(self.x);
5583 __tmp.put_f32_le(self.y);
5584 __tmp.put_f32_le(self.z);
5585 if matches!(version, MavlinkVersion::V2) {
5586 for val in &self.covariance {
5587 __tmp.put_f32_le(*val);
5588 }
5589 let len = __tmp.len();
5590 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5591 } else {
5592 __tmp.len()
5593 }
5594 }
5595}
5596#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5597#[doc = ""]
5598#[doc = "ID: 7"]
5599#[derive(Debug, Clone, PartialEq)]
5600#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5601#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5602pub struct AUTH_KEY_DATA {
5603 #[doc = "key"]
5604 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5605 pub key: [u8; 32],
5606}
5607impl AUTH_KEY_DATA {
5608 pub const ENCODED_LEN: usize = 32usize;
5609 pub const DEFAULT: Self = Self {
5610 key: [0_u8; 32usize],
5611 };
5612 #[cfg(feature = "arbitrary")]
5613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5614 use arbitrary::{Arbitrary, Unstructured};
5615 let mut buf = [0u8; 1024];
5616 rng.fill_bytes(&mut buf);
5617 let mut unstructured = Unstructured::new(&buf);
5618 Self::arbitrary(&mut unstructured).unwrap_or_default()
5619 }
5620}
5621impl Default for AUTH_KEY_DATA {
5622 fn default() -> Self {
5623 Self::DEFAULT.clone()
5624 }
5625}
5626impl MessageData for AUTH_KEY_DATA {
5627 type Message = MavMessage;
5628 const ID: u32 = 7u32;
5629 const NAME: &'static str = "AUTH_KEY";
5630 const EXTRA_CRC: u8 = 119u8;
5631 const ENCODED_LEN: usize = 32usize;
5632 fn deser(
5633 _version: MavlinkVersion,
5634 __input: &[u8],
5635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5636 let avail_len = __input.len();
5637 let mut payload_buf = [0; Self::ENCODED_LEN];
5638 let mut buf = if avail_len < Self::ENCODED_LEN {
5639 payload_buf[0..avail_len].copy_from_slice(__input);
5640 Bytes::new(&payload_buf)
5641 } else {
5642 Bytes::new(__input)
5643 };
5644 let mut __struct = Self::default();
5645 for v in &mut __struct.key {
5646 let val = buf.get_u8();
5647 *v = val;
5648 }
5649 Ok(__struct)
5650 }
5651 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5652 let mut __tmp = BytesMut::new(bytes);
5653 #[allow(clippy::absurd_extreme_comparisons)]
5654 #[allow(unused_comparisons)]
5655 if __tmp.remaining() < Self::ENCODED_LEN {
5656 panic!(
5657 "buffer is too small (need {} bytes, but got {})",
5658 Self::ENCODED_LEN,
5659 __tmp.remaining(),
5660 )
5661 }
5662 for val in &self.key {
5663 __tmp.put_u8(*val);
5664 }
5665 if matches!(version, MavlinkVersion::V2) {
5666 let len = __tmp.len();
5667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5668 } else {
5669 __tmp.len()
5670 }
5671 }
5672}
5673#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5674#[doc = ""]
5675#[doc = "ID: 286"]
5676#[derive(Debug, Clone, PartialEq)]
5677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5679pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5680 #[doc = "Timestamp (time since system boot)."]
5681 pub time_boot_us: u64,
5682 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5683 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5684 pub q: [f32; 4],
5685 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5686 pub q_estimated_delay_us: u32,
5687 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5688 pub vx: f32,
5689 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5690 pub vy: f32,
5691 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5692 pub vz: f32,
5693 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5694 pub v_estimated_delay_us: u32,
5695 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5696 pub feed_forward_angular_velocity_z: f32,
5697 #[doc = "Bitmap indicating which estimator outputs are valid."]
5698 pub estimator_status: EstimatorStatusFlags,
5699 #[doc = "System ID"]
5700 pub target_system: u8,
5701 #[doc = "Component ID"]
5702 pub target_component: u8,
5703 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5704 pub landed_state: MavLandedState,
5705 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5707 pub angular_velocity_z: f32,
5708}
5709impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5710 pub const ENCODED_LEN: usize = 57usize;
5711 pub const DEFAULT: Self = Self {
5712 time_boot_us: 0_u64,
5713 q: [0.0_f32; 4usize],
5714 q_estimated_delay_us: 0_u32,
5715 vx: 0.0_f32,
5716 vy: 0.0_f32,
5717 vz: 0.0_f32,
5718 v_estimated_delay_us: 0_u32,
5719 feed_forward_angular_velocity_z: 0.0_f32,
5720 estimator_status: EstimatorStatusFlags::DEFAULT,
5721 target_system: 0_u8,
5722 target_component: 0_u8,
5723 landed_state: MavLandedState::DEFAULT,
5724 angular_velocity_z: 0.0_f32,
5725 };
5726 #[cfg(feature = "arbitrary")]
5727 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5728 use arbitrary::{Arbitrary, Unstructured};
5729 let mut buf = [0u8; 1024];
5730 rng.fill_bytes(&mut buf);
5731 let mut unstructured = Unstructured::new(&buf);
5732 Self::arbitrary(&mut unstructured).unwrap_or_default()
5733 }
5734}
5735impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5736 fn default() -> Self {
5737 Self::DEFAULT.clone()
5738 }
5739}
5740impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5741 type Message = MavMessage;
5742 const ID: u32 = 286u32;
5743 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
5744 const EXTRA_CRC: u8 = 210u8;
5745 const ENCODED_LEN: usize = 57usize;
5746 fn deser(
5747 _version: MavlinkVersion,
5748 __input: &[u8],
5749 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5750 let avail_len = __input.len();
5751 let mut payload_buf = [0; Self::ENCODED_LEN];
5752 let mut buf = if avail_len < Self::ENCODED_LEN {
5753 payload_buf[0..avail_len].copy_from_slice(__input);
5754 Bytes::new(&payload_buf)
5755 } else {
5756 Bytes::new(__input)
5757 };
5758 let mut __struct = Self::default();
5759 __struct.time_boot_us = buf.get_u64_le();
5760 for v in &mut __struct.q {
5761 let val = buf.get_f32_le();
5762 *v = val;
5763 }
5764 __struct.q_estimated_delay_us = buf.get_u32_le();
5765 __struct.vx = buf.get_f32_le();
5766 __struct.vy = buf.get_f32_le();
5767 __struct.vz = buf.get_f32_le();
5768 __struct.v_estimated_delay_us = buf.get_u32_le();
5769 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
5770 let tmp = buf.get_u16_le();
5771 __struct.estimator_status = EstimatorStatusFlags::from_bits(
5772 tmp & EstimatorStatusFlags::all().bits(),
5773 )
5774 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5775 flag_type: "EstimatorStatusFlags",
5776 value: tmp as u32,
5777 })?;
5778 __struct.target_system = buf.get_u8();
5779 __struct.target_component = buf.get_u8();
5780 let tmp = buf.get_u8();
5781 __struct.landed_state =
5782 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5783 enum_type: "MavLandedState",
5784 value: tmp as u32,
5785 })?;
5786 __struct.angular_velocity_z = buf.get_f32_le();
5787 Ok(__struct)
5788 }
5789 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5790 let mut __tmp = BytesMut::new(bytes);
5791 #[allow(clippy::absurd_extreme_comparisons)]
5792 #[allow(unused_comparisons)]
5793 if __tmp.remaining() < Self::ENCODED_LEN {
5794 panic!(
5795 "buffer is too small (need {} bytes, but got {})",
5796 Self::ENCODED_LEN,
5797 __tmp.remaining(),
5798 )
5799 }
5800 __tmp.put_u64_le(self.time_boot_us);
5801 for val in &self.q {
5802 __tmp.put_f32_le(*val);
5803 }
5804 __tmp.put_u32_le(self.q_estimated_delay_us);
5805 __tmp.put_f32_le(self.vx);
5806 __tmp.put_f32_le(self.vy);
5807 __tmp.put_f32_le(self.vz);
5808 __tmp.put_u32_le(self.v_estimated_delay_us);
5809 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
5810 __tmp.put_u16_le(self.estimator_status.bits());
5811 __tmp.put_u8(self.target_system);
5812 __tmp.put_u8(self.target_component);
5813 __tmp.put_u8(self.landed_state as u8);
5814 if matches!(version, MavlinkVersion::V2) {
5815 __tmp.put_f32_le(self.angular_velocity_z);
5816 let len = __tmp.len();
5817 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5818 } else {
5819 __tmp.len()
5820 }
5821 }
5822}
5823#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
5824#[doc = ""]
5825#[doc = "ID: 148"]
5826#[derive(Debug, Clone, PartialEq)]
5827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5829pub struct AUTOPILOT_VERSION_DATA {
5830 #[doc = "Bitmap of capabilities"]
5831 pub capabilities: MavProtocolCapability,
5832 #[doc = "UID if provided by hardware (see uid2)"]
5833 pub uid: u64,
5834 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
5835 pub flight_sw_version: u32,
5836 #[doc = "Middleware version number"]
5837 pub middleware_sw_version: u32,
5838 #[doc = "Operating system version number"]
5839 pub os_sw_version: u32,
5840 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
5841 pub board_version: u32,
5842 #[doc = "ID of the board vendor"]
5843 pub vendor_id: u16,
5844 #[doc = "ID of the product"]
5845 pub product_id: u16,
5846 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5847 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5848 pub flight_custom_version: [u8; 8],
5849 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5850 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5851 pub middleware_custom_version: [u8; 8],
5852 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5853 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5854 pub os_custom_version: [u8; 8],
5855 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
5856 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5857 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5858 pub uid2: [u8; 18],
5859}
5860impl AUTOPILOT_VERSION_DATA {
5861 pub const ENCODED_LEN: usize = 78usize;
5862 pub const DEFAULT: Self = Self {
5863 capabilities: MavProtocolCapability::DEFAULT,
5864 uid: 0_u64,
5865 flight_sw_version: 0_u32,
5866 middleware_sw_version: 0_u32,
5867 os_sw_version: 0_u32,
5868 board_version: 0_u32,
5869 vendor_id: 0_u16,
5870 product_id: 0_u16,
5871 flight_custom_version: [0_u8; 8usize],
5872 middleware_custom_version: [0_u8; 8usize],
5873 os_custom_version: [0_u8; 8usize],
5874 uid2: [0_u8; 18usize],
5875 };
5876 #[cfg(feature = "arbitrary")]
5877 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5878 use arbitrary::{Arbitrary, Unstructured};
5879 let mut buf = [0u8; 1024];
5880 rng.fill_bytes(&mut buf);
5881 let mut unstructured = Unstructured::new(&buf);
5882 Self::arbitrary(&mut unstructured).unwrap_or_default()
5883 }
5884}
5885impl Default for AUTOPILOT_VERSION_DATA {
5886 fn default() -> Self {
5887 Self::DEFAULT.clone()
5888 }
5889}
5890impl MessageData for AUTOPILOT_VERSION_DATA {
5891 type Message = MavMessage;
5892 const ID: u32 = 148u32;
5893 const NAME: &'static str = "AUTOPILOT_VERSION";
5894 const EXTRA_CRC: u8 = 178u8;
5895 const ENCODED_LEN: usize = 78usize;
5896 fn deser(
5897 _version: MavlinkVersion,
5898 __input: &[u8],
5899 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5900 let avail_len = __input.len();
5901 let mut payload_buf = [0; Self::ENCODED_LEN];
5902 let mut buf = if avail_len < Self::ENCODED_LEN {
5903 payload_buf[0..avail_len].copy_from_slice(__input);
5904 Bytes::new(&payload_buf)
5905 } else {
5906 Bytes::new(__input)
5907 };
5908 let mut __struct = Self::default();
5909 let tmp = buf.get_u64_le();
5910 __struct.capabilities = MavProtocolCapability::from_bits(
5911 tmp & MavProtocolCapability::all().bits(),
5912 )
5913 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5914 flag_type: "MavProtocolCapability",
5915 value: tmp as u32,
5916 })?;
5917 __struct.uid = buf.get_u64_le();
5918 __struct.flight_sw_version = buf.get_u32_le();
5919 __struct.middleware_sw_version = buf.get_u32_le();
5920 __struct.os_sw_version = buf.get_u32_le();
5921 __struct.board_version = buf.get_u32_le();
5922 __struct.vendor_id = buf.get_u16_le();
5923 __struct.product_id = buf.get_u16_le();
5924 for v in &mut __struct.flight_custom_version {
5925 let val = buf.get_u8();
5926 *v = val;
5927 }
5928 for v in &mut __struct.middleware_custom_version {
5929 let val = buf.get_u8();
5930 *v = val;
5931 }
5932 for v in &mut __struct.os_custom_version {
5933 let val = buf.get_u8();
5934 *v = val;
5935 }
5936 for v in &mut __struct.uid2 {
5937 let val = buf.get_u8();
5938 *v = val;
5939 }
5940 Ok(__struct)
5941 }
5942 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5943 let mut __tmp = BytesMut::new(bytes);
5944 #[allow(clippy::absurd_extreme_comparisons)]
5945 #[allow(unused_comparisons)]
5946 if __tmp.remaining() < Self::ENCODED_LEN {
5947 panic!(
5948 "buffer is too small (need {} bytes, but got {})",
5949 Self::ENCODED_LEN,
5950 __tmp.remaining(),
5951 )
5952 }
5953 __tmp.put_u64_le(self.capabilities.bits());
5954 __tmp.put_u64_le(self.uid);
5955 __tmp.put_u32_le(self.flight_sw_version);
5956 __tmp.put_u32_le(self.middleware_sw_version);
5957 __tmp.put_u32_le(self.os_sw_version);
5958 __tmp.put_u32_le(self.board_version);
5959 __tmp.put_u16_le(self.vendor_id);
5960 __tmp.put_u16_le(self.product_id);
5961 for val in &self.flight_custom_version {
5962 __tmp.put_u8(*val);
5963 }
5964 for val in &self.middleware_custom_version {
5965 __tmp.put_u8(*val);
5966 }
5967 for val in &self.os_custom_version {
5968 __tmp.put_u8(*val);
5969 }
5970 if matches!(version, MavlinkVersion::V2) {
5971 for val in &self.uid2 {
5972 __tmp.put_u8(*val);
5973 }
5974 let len = __tmp.len();
5975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5976 } else {
5977 __tmp.len()
5978 }
5979 }
5980}
5981#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
5982#[doc = ""]
5983#[doc = "ID: 435"]
5984#[derive(Debug, Clone, PartialEq)]
5985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5987pub struct AVAILABLE_MODES_DATA {
5988 #[doc = "A bitfield for use for autopilot-specific flags"]
5989 pub custom_mode: u32,
5990 #[doc = "Mode properties."]
5991 pub properties: MavModeProperty,
5992 #[doc = "The total number of available modes for the current vehicle type."]
5993 pub number_modes: u8,
5994 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
5995 pub mode_index: u8,
5996 #[doc = "Standard mode."]
5997 pub standard_mode: MavStandardMode,
5998 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
5999 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6000 pub mode_name: [u8; 35],
6001}
6002impl AVAILABLE_MODES_DATA {
6003 pub const ENCODED_LEN: usize = 46usize;
6004 pub const DEFAULT: Self = Self {
6005 custom_mode: 0_u32,
6006 properties: MavModeProperty::DEFAULT,
6007 number_modes: 0_u8,
6008 mode_index: 0_u8,
6009 standard_mode: MavStandardMode::DEFAULT,
6010 mode_name: [0_u8; 35usize],
6011 };
6012 #[cfg(feature = "arbitrary")]
6013 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6014 use arbitrary::{Arbitrary, Unstructured};
6015 let mut buf = [0u8; 1024];
6016 rng.fill_bytes(&mut buf);
6017 let mut unstructured = Unstructured::new(&buf);
6018 Self::arbitrary(&mut unstructured).unwrap_or_default()
6019 }
6020}
6021impl Default for AVAILABLE_MODES_DATA {
6022 fn default() -> Self {
6023 Self::DEFAULT.clone()
6024 }
6025}
6026impl MessageData for AVAILABLE_MODES_DATA {
6027 type Message = MavMessage;
6028 const ID: u32 = 435u32;
6029 const NAME: &'static str = "AVAILABLE_MODES";
6030 const EXTRA_CRC: u8 = 134u8;
6031 const ENCODED_LEN: usize = 46usize;
6032 fn deser(
6033 _version: MavlinkVersion,
6034 __input: &[u8],
6035 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6036 let avail_len = __input.len();
6037 let mut payload_buf = [0; Self::ENCODED_LEN];
6038 let mut buf = if avail_len < Self::ENCODED_LEN {
6039 payload_buf[0..avail_len].copy_from_slice(__input);
6040 Bytes::new(&payload_buf)
6041 } else {
6042 Bytes::new(__input)
6043 };
6044 let mut __struct = Self::default();
6045 __struct.custom_mode = buf.get_u32_le();
6046 let tmp = buf.get_u32_le();
6047 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6048 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6049 flag_type: "MavModeProperty",
6050 value: tmp as u32,
6051 })?;
6052 __struct.number_modes = buf.get_u8();
6053 __struct.mode_index = buf.get_u8();
6054 let tmp = buf.get_u8();
6055 __struct.standard_mode =
6056 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6057 enum_type: "MavStandardMode",
6058 value: tmp as u32,
6059 })?;
6060 for v in &mut __struct.mode_name {
6061 let val = buf.get_u8();
6062 *v = val;
6063 }
6064 Ok(__struct)
6065 }
6066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6067 let mut __tmp = BytesMut::new(bytes);
6068 #[allow(clippy::absurd_extreme_comparisons)]
6069 #[allow(unused_comparisons)]
6070 if __tmp.remaining() < Self::ENCODED_LEN {
6071 panic!(
6072 "buffer is too small (need {} bytes, but got {})",
6073 Self::ENCODED_LEN,
6074 __tmp.remaining(),
6075 )
6076 }
6077 __tmp.put_u32_le(self.custom_mode);
6078 __tmp.put_u32_le(self.properties.bits());
6079 __tmp.put_u8(self.number_modes);
6080 __tmp.put_u8(self.mode_index);
6081 __tmp.put_u8(self.standard_mode as u8);
6082 for val in &self.mode_name {
6083 __tmp.put_u8(*val);
6084 }
6085 if matches!(version, MavlinkVersion::V2) {
6086 let len = __tmp.len();
6087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6088 } else {
6089 __tmp.len()
6090 }
6091 }
6092}
6093#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6094#[doc = ""]
6095#[doc = "ID: 437"]
6096#[derive(Debug, Clone, PartialEq)]
6097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6099pub struct AVAILABLE_MODES_MONITOR_DATA {
6100 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6101 pub seq: u8,
6102}
6103impl AVAILABLE_MODES_MONITOR_DATA {
6104 pub const ENCODED_LEN: usize = 1usize;
6105 pub const DEFAULT: Self = Self { seq: 0_u8 };
6106 #[cfg(feature = "arbitrary")]
6107 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6108 use arbitrary::{Arbitrary, Unstructured};
6109 let mut buf = [0u8; 1024];
6110 rng.fill_bytes(&mut buf);
6111 let mut unstructured = Unstructured::new(&buf);
6112 Self::arbitrary(&mut unstructured).unwrap_or_default()
6113 }
6114}
6115impl Default for AVAILABLE_MODES_MONITOR_DATA {
6116 fn default() -> Self {
6117 Self::DEFAULT.clone()
6118 }
6119}
6120impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6121 type Message = MavMessage;
6122 const ID: u32 = 437u32;
6123 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6124 const EXTRA_CRC: u8 = 30u8;
6125 const ENCODED_LEN: usize = 1usize;
6126 fn deser(
6127 _version: MavlinkVersion,
6128 __input: &[u8],
6129 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6130 let avail_len = __input.len();
6131 let mut payload_buf = [0; Self::ENCODED_LEN];
6132 let mut buf = if avail_len < Self::ENCODED_LEN {
6133 payload_buf[0..avail_len].copy_from_slice(__input);
6134 Bytes::new(&payload_buf)
6135 } else {
6136 Bytes::new(__input)
6137 };
6138 let mut __struct = Self::default();
6139 __struct.seq = buf.get_u8();
6140 Ok(__struct)
6141 }
6142 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6143 let mut __tmp = BytesMut::new(bytes);
6144 #[allow(clippy::absurd_extreme_comparisons)]
6145 #[allow(unused_comparisons)]
6146 if __tmp.remaining() < Self::ENCODED_LEN {
6147 panic!(
6148 "buffer is too small (need {} bytes, but got {})",
6149 Self::ENCODED_LEN,
6150 __tmp.remaining(),
6151 )
6152 }
6153 __tmp.put_u8(self.seq);
6154 if matches!(version, MavlinkVersion::V2) {
6155 let len = __tmp.len();
6156 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6157 } else {
6158 __tmp.len()
6159 }
6160 }
6161}
6162#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6163#[doc = ""]
6164#[doc = "ID: 372"]
6165#[derive(Debug, Clone, PartialEq)]
6166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6168pub struct BATTERY_INFO_DATA {
6169 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6170 pub discharge_minimum_voltage: f32,
6171 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6172 pub charging_minimum_voltage: f32,
6173 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6174 pub resting_minimum_voltage: f32,
6175 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6176 pub charging_maximum_voltage: f32,
6177 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6178 pub charging_maximum_current: f32,
6179 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6180 pub nominal_voltage: f32,
6181 #[doc = "Maximum pack discharge current. 0: field not provided."]
6182 pub discharge_maximum_current: f32,
6183 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6184 pub discharge_maximum_burst_current: f32,
6185 #[doc = "Fully charged design capacity. 0: field not provided."]
6186 pub design_capacity: f32,
6187 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6188 pub full_charge_capacity: f32,
6189 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6190 pub cycle_count: u16,
6191 #[doc = "Battery weight. 0: field not provided."]
6192 pub weight: u16,
6193 #[doc = "Battery ID"]
6194 pub id: u8,
6195 #[doc = "Function of the battery."]
6196 pub battery_function: MavBatteryFunction,
6197 #[doc = "Type (chemistry) of the battery."]
6198 pub mavtype: MavBatteryType,
6199 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6200 pub state_of_health: u8,
6201 #[doc = "Number of battery cells in series. 0: field not provided."]
6202 pub cells_in_series: u8,
6203 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6204 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6205 pub manufacture_date: [u8; 9],
6206 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6207 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6208 pub serial_number: [u8; 32],
6209 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6210 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6211 pub name: [u8; 50],
6212}
6213impl BATTERY_INFO_DATA {
6214 pub const ENCODED_LEN: usize = 140usize;
6215 pub const DEFAULT: Self = Self {
6216 discharge_minimum_voltage: 0.0_f32,
6217 charging_minimum_voltage: 0.0_f32,
6218 resting_minimum_voltage: 0.0_f32,
6219 charging_maximum_voltage: 0.0_f32,
6220 charging_maximum_current: 0.0_f32,
6221 nominal_voltage: 0.0_f32,
6222 discharge_maximum_current: 0.0_f32,
6223 discharge_maximum_burst_current: 0.0_f32,
6224 design_capacity: 0.0_f32,
6225 full_charge_capacity: 0.0_f32,
6226 cycle_count: 0_u16,
6227 weight: 0_u16,
6228 id: 0_u8,
6229 battery_function: MavBatteryFunction::DEFAULT,
6230 mavtype: MavBatteryType::DEFAULT,
6231 state_of_health: 0_u8,
6232 cells_in_series: 0_u8,
6233 manufacture_date: [0_u8; 9usize],
6234 serial_number: [0_u8; 32usize],
6235 name: [0_u8; 50usize],
6236 };
6237 #[cfg(feature = "arbitrary")]
6238 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6239 use arbitrary::{Arbitrary, Unstructured};
6240 let mut buf = [0u8; 1024];
6241 rng.fill_bytes(&mut buf);
6242 let mut unstructured = Unstructured::new(&buf);
6243 Self::arbitrary(&mut unstructured).unwrap_or_default()
6244 }
6245}
6246impl Default for BATTERY_INFO_DATA {
6247 fn default() -> Self {
6248 Self::DEFAULT.clone()
6249 }
6250}
6251impl MessageData for BATTERY_INFO_DATA {
6252 type Message = MavMessage;
6253 const ID: u32 = 372u32;
6254 const NAME: &'static str = "BATTERY_INFO";
6255 const EXTRA_CRC: u8 = 26u8;
6256 const ENCODED_LEN: usize = 140usize;
6257 fn deser(
6258 _version: MavlinkVersion,
6259 __input: &[u8],
6260 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6261 let avail_len = __input.len();
6262 let mut payload_buf = [0; Self::ENCODED_LEN];
6263 let mut buf = if avail_len < Self::ENCODED_LEN {
6264 payload_buf[0..avail_len].copy_from_slice(__input);
6265 Bytes::new(&payload_buf)
6266 } else {
6267 Bytes::new(__input)
6268 };
6269 let mut __struct = Self::default();
6270 __struct.discharge_minimum_voltage = buf.get_f32_le();
6271 __struct.charging_minimum_voltage = buf.get_f32_le();
6272 __struct.resting_minimum_voltage = buf.get_f32_le();
6273 __struct.charging_maximum_voltage = buf.get_f32_le();
6274 __struct.charging_maximum_current = buf.get_f32_le();
6275 __struct.nominal_voltage = buf.get_f32_le();
6276 __struct.discharge_maximum_current = buf.get_f32_le();
6277 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6278 __struct.design_capacity = buf.get_f32_le();
6279 __struct.full_charge_capacity = buf.get_f32_le();
6280 __struct.cycle_count = buf.get_u16_le();
6281 __struct.weight = buf.get_u16_le();
6282 __struct.id = buf.get_u8();
6283 let tmp = buf.get_u8();
6284 __struct.battery_function =
6285 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6286 enum_type: "MavBatteryFunction",
6287 value: tmp as u32,
6288 })?;
6289 let tmp = buf.get_u8();
6290 __struct.mavtype =
6291 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6292 enum_type: "MavBatteryType",
6293 value: tmp as u32,
6294 })?;
6295 __struct.state_of_health = buf.get_u8();
6296 __struct.cells_in_series = buf.get_u8();
6297 for v in &mut __struct.manufacture_date {
6298 let val = buf.get_u8();
6299 *v = val;
6300 }
6301 for v in &mut __struct.serial_number {
6302 let val = buf.get_u8();
6303 *v = val;
6304 }
6305 for v in &mut __struct.name {
6306 let val = buf.get_u8();
6307 *v = val;
6308 }
6309 Ok(__struct)
6310 }
6311 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6312 let mut __tmp = BytesMut::new(bytes);
6313 #[allow(clippy::absurd_extreme_comparisons)]
6314 #[allow(unused_comparisons)]
6315 if __tmp.remaining() < Self::ENCODED_LEN {
6316 panic!(
6317 "buffer is too small (need {} bytes, but got {})",
6318 Self::ENCODED_LEN,
6319 __tmp.remaining(),
6320 )
6321 }
6322 __tmp.put_f32_le(self.discharge_minimum_voltage);
6323 __tmp.put_f32_le(self.charging_minimum_voltage);
6324 __tmp.put_f32_le(self.resting_minimum_voltage);
6325 __tmp.put_f32_le(self.charging_maximum_voltage);
6326 __tmp.put_f32_le(self.charging_maximum_current);
6327 __tmp.put_f32_le(self.nominal_voltage);
6328 __tmp.put_f32_le(self.discharge_maximum_current);
6329 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6330 __tmp.put_f32_le(self.design_capacity);
6331 __tmp.put_f32_le(self.full_charge_capacity);
6332 __tmp.put_u16_le(self.cycle_count);
6333 __tmp.put_u16_le(self.weight);
6334 __tmp.put_u8(self.id);
6335 __tmp.put_u8(self.battery_function as u8);
6336 __tmp.put_u8(self.mavtype as u8);
6337 __tmp.put_u8(self.state_of_health);
6338 __tmp.put_u8(self.cells_in_series);
6339 for val in &self.manufacture_date {
6340 __tmp.put_u8(*val);
6341 }
6342 for val in &self.serial_number {
6343 __tmp.put_u8(*val);
6344 }
6345 for val in &self.name {
6346 __tmp.put_u8(*val);
6347 }
6348 if matches!(version, MavlinkVersion::V2) {
6349 let len = __tmp.len();
6350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6351 } else {
6352 __tmp.len()
6353 }
6354 }
6355}
6356#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6357#[doc = ""]
6358#[doc = "ID: 147"]
6359#[derive(Debug, Clone, PartialEq)]
6360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6362pub struct BATTERY_STATUS_DATA {
6363 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6364 pub current_consumed: i32,
6365 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6366 pub energy_consumed: i32,
6367 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6368 pub temperature: i16,
6369 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6370 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6371 pub voltages: [u16; 10],
6372 #[doc = "Battery current, -1: autopilot does not measure the current"]
6373 pub current_battery: i16,
6374 #[doc = "Battery ID"]
6375 pub id: u8,
6376 #[doc = "Function of the battery"]
6377 pub battery_function: MavBatteryFunction,
6378 #[doc = "Type (chemistry) of the battery"]
6379 pub mavtype: MavBatteryType,
6380 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6381 pub battery_remaining: i8,
6382 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6383 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6384 pub time_remaining: i32,
6385 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6386 #[cfg_attr(feature = "serde", serde(default))]
6387 pub charge_state: MavBatteryChargeState,
6388 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6389 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6390 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6391 pub voltages_ext: [u16; 4],
6392 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6393 #[cfg_attr(feature = "serde", serde(default))]
6394 pub mode: MavBatteryMode,
6395 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6396 #[cfg_attr(feature = "serde", serde(default))]
6397 pub fault_bitmask: MavBatteryFault,
6398}
6399impl BATTERY_STATUS_DATA {
6400 pub const ENCODED_LEN: usize = 54usize;
6401 pub const DEFAULT: Self = Self {
6402 current_consumed: 0_i32,
6403 energy_consumed: 0_i32,
6404 temperature: 0_i16,
6405 voltages: [0_u16; 10usize],
6406 current_battery: 0_i16,
6407 id: 0_u8,
6408 battery_function: MavBatteryFunction::DEFAULT,
6409 mavtype: MavBatteryType::DEFAULT,
6410 battery_remaining: 0_i8,
6411 time_remaining: 0_i32,
6412 charge_state: MavBatteryChargeState::DEFAULT,
6413 voltages_ext: [0_u16; 4usize],
6414 mode: MavBatteryMode::DEFAULT,
6415 fault_bitmask: MavBatteryFault::DEFAULT,
6416 };
6417 #[cfg(feature = "arbitrary")]
6418 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6419 use arbitrary::{Arbitrary, Unstructured};
6420 let mut buf = [0u8; 1024];
6421 rng.fill_bytes(&mut buf);
6422 let mut unstructured = Unstructured::new(&buf);
6423 Self::arbitrary(&mut unstructured).unwrap_or_default()
6424 }
6425}
6426impl Default for BATTERY_STATUS_DATA {
6427 fn default() -> Self {
6428 Self::DEFAULT.clone()
6429 }
6430}
6431impl MessageData for BATTERY_STATUS_DATA {
6432 type Message = MavMessage;
6433 const ID: u32 = 147u32;
6434 const NAME: &'static str = "BATTERY_STATUS";
6435 const EXTRA_CRC: u8 = 154u8;
6436 const ENCODED_LEN: usize = 54usize;
6437 fn deser(
6438 _version: MavlinkVersion,
6439 __input: &[u8],
6440 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6441 let avail_len = __input.len();
6442 let mut payload_buf = [0; Self::ENCODED_LEN];
6443 let mut buf = if avail_len < Self::ENCODED_LEN {
6444 payload_buf[0..avail_len].copy_from_slice(__input);
6445 Bytes::new(&payload_buf)
6446 } else {
6447 Bytes::new(__input)
6448 };
6449 let mut __struct = Self::default();
6450 __struct.current_consumed = buf.get_i32_le();
6451 __struct.energy_consumed = buf.get_i32_le();
6452 __struct.temperature = buf.get_i16_le();
6453 for v in &mut __struct.voltages {
6454 let val = buf.get_u16_le();
6455 *v = val;
6456 }
6457 __struct.current_battery = buf.get_i16_le();
6458 __struct.id = buf.get_u8();
6459 let tmp = buf.get_u8();
6460 __struct.battery_function =
6461 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6462 enum_type: "MavBatteryFunction",
6463 value: tmp as u32,
6464 })?;
6465 let tmp = buf.get_u8();
6466 __struct.mavtype =
6467 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6468 enum_type: "MavBatteryType",
6469 value: tmp as u32,
6470 })?;
6471 __struct.battery_remaining = buf.get_i8();
6472 __struct.time_remaining = buf.get_i32_le();
6473 let tmp = buf.get_u8();
6474 __struct.charge_state =
6475 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6476 enum_type: "MavBatteryChargeState",
6477 value: tmp as u32,
6478 })?;
6479 for v in &mut __struct.voltages_ext {
6480 let val = buf.get_u16_le();
6481 *v = val;
6482 }
6483 let tmp = buf.get_u8();
6484 __struct.mode =
6485 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6486 enum_type: "MavBatteryMode",
6487 value: tmp as u32,
6488 })?;
6489 let tmp = buf.get_u32_le();
6490 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6491 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6492 flag_type: "MavBatteryFault",
6493 value: tmp as u32,
6494 })?;
6495 Ok(__struct)
6496 }
6497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6498 let mut __tmp = BytesMut::new(bytes);
6499 #[allow(clippy::absurd_extreme_comparisons)]
6500 #[allow(unused_comparisons)]
6501 if __tmp.remaining() < Self::ENCODED_LEN {
6502 panic!(
6503 "buffer is too small (need {} bytes, but got {})",
6504 Self::ENCODED_LEN,
6505 __tmp.remaining(),
6506 )
6507 }
6508 __tmp.put_i32_le(self.current_consumed);
6509 __tmp.put_i32_le(self.energy_consumed);
6510 __tmp.put_i16_le(self.temperature);
6511 for val in &self.voltages {
6512 __tmp.put_u16_le(*val);
6513 }
6514 __tmp.put_i16_le(self.current_battery);
6515 __tmp.put_u8(self.id);
6516 __tmp.put_u8(self.battery_function as u8);
6517 __tmp.put_u8(self.mavtype as u8);
6518 __tmp.put_i8(self.battery_remaining);
6519 if matches!(version, MavlinkVersion::V2) {
6520 __tmp.put_i32_le(self.time_remaining);
6521 __tmp.put_u8(self.charge_state as u8);
6522 for val in &self.voltages_ext {
6523 __tmp.put_u16_le(*val);
6524 }
6525 __tmp.put_u8(self.mode as u8);
6526 __tmp.put_u32_le(self.fault_bitmask.bits());
6527 let len = __tmp.len();
6528 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6529 } else {
6530 __tmp.len()
6531 }
6532 }
6533}
6534#[doc = "Report button state change."]
6535#[doc = ""]
6536#[doc = "ID: 257"]
6537#[derive(Debug, Clone, PartialEq)]
6538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6540pub struct BUTTON_CHANGE_DATA {
6541 #[doc = "Timestamp (time since system boot)."]
6542 pub time_boot_ms: u32,
6543 #[doc = "Time of last change of button state."]
6544 pub last_change_ms: u32,
6545 #[doc = "Bitmap for state of buttons."]
6546 pub state: u8,
6547}
6548impl BUTTON_CHANGE_DATA {
6549 pub const ENCODED_LEN: usize = 9usize;
6550 pub const DEFAULT: Self = Self {
6551 time_boot_ms: 0_u32,
6552 last_change_ms: 0_u32,
6553 state: 0_u8,
6554 };
6555 #[cfg(feature = "arbitrary")]
6556 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6557 use arbitrary::{Arbitrary, Unstructured};
6558 let mut buf = [0u8; 1024];
6559 rng.fill_bytes(&mut buf);
6560 let mut unstructured = Unstructured::new(&buf);
6561 Self::arbitrary(&mut unstructured).unwrap_or_default()
6562 }
6563}
6564impl Default for BUTTON_CHANGE_DATA {
6565 fn default() -> Self {
6566 Self::DEFAULT.clone()
6567 }
6568}
6569impl MessageData for BUTTON_CHANGE_DATA {
6570 type Message = MavMessage;
6571 const ID: u32 = 257u32;
6572 const NAME: &'static str = "BUTTON_CHANGE";
6573 const EXTRA_CRC: u8 = 131u8;
6574 const ENCODED_LEN: usize = 9usize;
6575 fn deser(
6576 _version: MavlinkVersion,
6577 __input: &[u8],
6578 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6579 let avail_len = __input.len();
6580 let mut payload_buf = [0; Self::ENCODED_LEN];
6581 let mut buf = if avail_len < Self::ENCODED_LEN {
6582 payload_buf[0..avail_len].copy_from_slice(__input);
6583 Bytes::new(&payload_buf)
6584 } else {
6585 Bytes::new(__input)
6586 };
6587 let mut __struct = Self::default();
6588 __struct.time_boot_ms = buf.get_u32_le();
6589 __struct.last_change_ms = buf.get_u32_le();
6590 __struct.state = buf.get_u8();
6591 Ok(__struct)
6592 }
6593 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6594 let mut __tmp = BytesMut::new(bytes);
6595 #[allow(clippy::absurd_extreme_comparisons)]
6596 #[allow(unused_comparisons)]
6597 if __tmp.remaining() < Self::ENCODED_LEN {
6598 panic!(
6599 "buffer is too small (need {} bytes, but got {})",
6600 Self::ENCODED_LEN,
6601 __tmp.remaining(),
6602 )
6603 }
6604 __tmp.put_u32_le(self.time_boot_ms);
6605 __tmp.put_u32_le(self.last_change_ms);
6606 __tmp.put_u8(self.state);
6607 if matches!(version, MavlinkVersion::V2) {
6608 let len = __tmp.len();
6609 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6610 } else {
6611 __tmp.len()
6612 }
6613 }
6614}
6615#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6616#[doc = ""]
6617#[doc = "ID: 262"]
6618#[derive(Debug, Clone, PartialEq)]
6619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6621pub struct CAMERA_CAPTURE_STATUS_DATA {
6622 #[doc = "Timestamp (time since system boot)."]
6623 pub time_boot_ms: u32,
6624 #[doc = "Image capture interval"]
6625 pub image_interval: f32,
6626 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6627 pub recording_time_ms: u32,
6628 #[doc = "Available storage capacity."]
6629 pub available_capacity: f32,
6630 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6631 pub image_status: u8,
6632 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6633 pub video_status: u8,
6634 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6635 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6636 pub image_count: i32,
6637 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6638 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6639 pub camera_device_id: u8,
6640}
6641impl CAMERA_CAPTURE_STATUS_DATA {
6642 pub const ENCODED_LEN: usize = 23usize;
6643 pub const DEFAULT: Self = Self {
6644 time_boot_ms: 0_u32,
6645 image_interval: 0.0_f32,
6646 recording_time_ms: 0_u32,
6647 available_capacity: 0.0_f32,
6648 image_status: 0_u8,
6649 video_status: 0_u8,
6650 image_count: 0_i32,
6651 camera_device_id: 0_u8,
6652 };
6653 #[cfg(feature = "arbitrary")]
6654 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6655 use arbitrary::{Arbitrary, Unstructured};
6656 let mut buf = [0u8; 1024];
6657 rng.fill_bytes(&mut buf);
6658 let mut unstructured = Unstructured::new(&buf);
6659 Self::arbitrary(&mut unstructured).unwrap_or_default()
6660 }
6661}
6662impl Default for CAMERA_CAPTURE_STATUS_DATA {
6663 fn default() -> Self {
6664 Self::DEFAULT.clone()
6665 }
6666}
6667impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6668 type Message = MavMessage;
6669 const ID: u32 = 262u32;
6670 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6671 const EXTRA_CRC: u8 = 12u8;
6672 const ENCODED_LEN: usize = 23usize;
6673 fn deser(
6674 _version: MavlinkVersion,
6675 __input: &[u8],
6676 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6677 let avail_len = __input.len();
6678 let mut payload_buf = [0; Self::ENCODED_LEN];
6679 let mut buf = if avail_len < Self::ENCODED_LEN {
6680 payload_buf[0..avail_len].copy_from_slice(__input);
6681 Bytes::new(&payload_buf)
6682 } else {
6683 Bytes::new(__input)
6684 };
6685 let mut __struct = Self::default();
6686 __struct.time_boot_ms = buf.get_u32_le();
6687 __struct.image_interval = buf.get_f32_le();
6688 __struct.recording_time_ms = buf.get_u32_le();
6689 __struct.available_capacity = buf.get_f32_le();
6690 __struct.image_status = buf.get_u8();
6691 __struct.video_status = buf.get_u8();
6692 __struct.image_count = buf.get_i32_le();
6693 __struct.camera_device_id = buf.get_u8();
6694 Ok(__struct)
6695 }
6696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6697 let mut __tmp = BytesMut::new(bytes);
6698 #[allow(clippy::absurd_extreme_comparisons)]
6699 #[allow(unused_comparisons)]
6700 if __tmp.remaining() < Self::ENCODED_LEN {
6701 panic!(
6702 "buffer is too small (need {} bytes, but got {})",
6703 Self::ENCODED_LEN,
6704 __tmp.remaining(),
6705 )
6706 }
6707 __tmp.put_u32_le(self.time_boot_ms);
6708 __tmp.put_f32_le(self.image_interval);
6709 __tmp.put_u32_le(self.recording_time_ms);
6710 __tmp.put_f32_le(self.available_capacity);
6711 __tmp.put_u8(self.image_status);
6712 __tmp.put_u8(self.video_status);
6713 if matches!(version, MavlinkVersion::V2) {
6714 __tmp.put_i32_le(self.image_count);
6715 __tmp.put_u8(self.camera_device_id);
6716 let len = __tmp.len();
6717 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6718 } else {
6719 __tmp.len()
6720 }
6721 }
6722}
6723#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6724#[doc = ""]
6725#[doc = "ID: 271"]
6726#[derive(Debug, Clone, PartialEq)]
6727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6729pub struct CAMERA_FOV_STATUS_DATA {
6730 #[doc = "Timestamp (time since system boot)."]
6731 pub time_boot_ms: u32,
6732 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
6733 pub lat_camera: i32,
6734 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
6735 pub lon_camera: i32,
6736 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
6737 pub alt_camera: i32,
6738 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6739 pub lat_image: i32,
6740 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6741 pub lon_image: i32,
6742 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6743 pub alt_image: i32,
6744 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6745 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6746 pub q: [f32; 4],
6747 #[doc = "Horizontal field of view (NaN if unknown)."]
6748 pub hfov: f32,
6749 #[doc = "Vertical field of view (NaN if unknown)."]
6750 pub vfov: f32,
6751 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6752 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6753 pub camera_device_id: u8,
6754}
6755impl CAMERA_FOV_STATUS_DATA {
6756 pub const ENCODED_LEN: usize = 53usize;
6757 pub const DEFAULT: Self = Self {
6758 time_boot_ms: 0_u32,
6759 lat_camera: 0_i32,
6760 lon_camera: 0_i32,
6761 alt_camera: 0_i32,
6762 lat_image: 0_i32,
6763 lon_image: 0_i32,
6764 alt_image: 0_i32,
6765 q: [0.0_f32; 4usize],
6766 hfov: 0.0_f32,
6767 vfov: 0.0_f32,
6768 camera_device_id: 0_u8,
6769 };
6770 #[cfg(feature = "arbitrary")]
6771 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6772 use arbitrary::{Arbitrary, Unstructured};
6773 let mut buf = [0u8; 1024];
6774 rng.fill_bytes(&mut buf);
6775 let mut unstructured = Unstructured::new(&buf);
6776 Self::arbitrary(&mut unstructured).unwrap_or_default()
6777 }
6778}
6779impl Default for CAMERA_FOV_STATUS_DATA {
6780 fn default() -> Self {
6781 Self::DEFAULT.clone()
6782 }
6783}
6784impl MessageData for CAMERA_FOV_STATUS_DATA {
6785 type Message = MavMessage;
6786 const ID: u32 = 271u32;
6787 const NAME: &'static str = "CAMERA_FOV_STATUS";
6788 const EXTRA_CRC: u8 = 22u8;
6789 const ENCODED_LEN: usize = 53usize;
6790 fn deser(
6791 _version: MavlinkVersion,
6792 __input: &[u8],
6793 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6794 let avail_len = __input.len();
6795 let mut payload_buf = [0; Self::ENCODED_LEN];
6796 let mut buf = if avail_len < Self::ENCODED_LEN {
6797 payload_buf[0..avail_len].copy_from_slice(__input);
6798 Bytes::new(&payload_buf)
6799 } else {
6800 Bytes::new(__input)
6801 };
6802 let mut __struct = Self::default();
6803 __struct.time_boot_ms = buf.get_u32_le();
6804 __struct.lat_camera = buf.get_i32_le();
6805 __struct.lon_camera = buf.get_i32_le();
6806 __struct.alt_camera = buf.get_i32_le();
6807 __struct.lat_image = buf.get_i32_le();
6808 __struct.lon_image = buf.get_i32_le();
6809 __struct.alt_image = buf.get_i32_le();
6810 for v in &mut __struct.q {
6811 let val = buf.get_f32_le();
6812 *v = val;
6813 }
6814 __struct.hfov = buf.get_f32_le();
6815 __struct.vfov = buf.get_f32_le();
6816 __struct.camera_device_id = buf.get_u8();
6817 Ok(__struct)
6818 }
6819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6820 let mut __tmp = BytesMut::new(bytes);
6821 #[allow(clippy::absurd_extreme_comparisons)]
6822 #[allow(unused_comparisons)]
6823 if __tmp.remaining() < Self::ENCODED_LEN {
6824 panic!(
6825 "buffer is too small (need {} bytes, but got {})",
6826 Self::ENCODED_LEN,
6827 __tmp.remaining(),
6828 )
6829 }
6830 __tmp.put_u32_le(self.time_boot_ms);
6831 __tmp.put_i32_le(self.lat_camera);
6832 __tmp.put_i32_le(self.lon_camera);
6833 __tmp.put_i32_le(self.alt_camera);
6834 __tmp.put_i32_le(self.lat_image);
6835 __tmp.put_i32_le(self.lon_image);
6836 __tmp.put_i32_le(self.alt_image);
6837 for val in &self.q {
6838 __tmp.put_f32_le(*val);
6839 }
6840 __tmp.put_f32_le(self.hfov);
6841 __tmp.put_f32_le(self.vfov);
6842 if matches!(version, MavlinkVersion::V2) {
6843 __tmp.put_u8(self.camera_device_id);
6844 let len = __tmp.len();
6845 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6846 } else {
6847 __tmp.len()
6848 }
6849 }
6850}
6851#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
6852#[doc = ""]
6853#[doc = "ID: 263"]
6854#[derive(Debug, Clone, PartialEq)]
6855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6856#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6857pub struct CAMERA_IMAGE_CAPTURED_DATA {
6858 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
6859 pub time_utc: u64,
6860 #[doc = "Timestamp (time since system boot)."]
6861 pub time_boot_ms: u32,
6862 #[doc = "Latitude where image was taken"]
6863 pub lat: i32,
6864 #[doc = "Longitude where capture was taken"]
6865 pub lon: i32,
6866 #[doc = "Altitude (MSL) where image was taken"]
6867 pub alt: i32,
6868 #[doc = "Altitude above ground"]
6869 pub relative_alt: i32,
6870 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6871 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6872 pub q: [f32; 4],
6873 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
6874 pub image_index: i32,
6875 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
6876 pub camera_id: u8,
6877 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
6878 pub capture_result: i8,
6879 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
6880 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6881 pub file_url: [u8; 205],
6882}
6883impl CAMERA_IMAGE_CAPTURED_DATA {
6884 pub const ENCODED_LEN: usize = 255usize;
6885 pub const DEFAULT: Self = Self {
6886 time_utc: 0_u64,
6887 time_boot_ms: 0_u32,
6888 lat: 0_i32,
6889 lon: 0_i32,
6890 alt: 0_i32,
6891 relative_alt: 0_i32,
6892 q: [0.0_f32; 4usize],
6893 image_index: 0_i32,
6894 camera_id: 0_u8,
6895 capture_result: 0_i8,
6896 file_url: [0_u8; 205usize],
6897 };
6898 #[cfg(feature = "arbitrary")]
6899 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6900 use arbitrary::{Arbitrary, Unstructured};
6901 let mut buf = [0u8; 1024];
6902 rng.fill_bytes(&mut buf);
6903 let mut unstructured = Unstructured::new(&buf);
6904 Self::arbitrary(&mut unstructured).unwrap_or_default()
6905 }
6906}
6907impl Default for CAMERA_IMAGE_CAPTURED_DATA {
6908 fn default() -> Self {
6909 Self::DEFAULT.clone()
6910 }
6911}
6912impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
6913 type Message = MavMessage;
6914 const ID: u32 = 263u32;
6915 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
6916 const EXTRA_CRC: u8 = 133u8;
6917 const ENCODED_LEN: usize = 255usize;
6918 fn deser(
6919 _version: MavlinkVersion,
6920 __input: &[u8],
6921 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6922 let avail_len = __input.len();
6923 let mut payload_buf = [0; Self::ENCODED_LEN];
6924 let mut buf = if avail_len < Self::ENCODED_LEN {
6925 payload_buf[0..avail_len].copy_from_slice(__input);
6926 Bytes::new(&payload_buf)
6927 } else {
6928 Bytes::new(__input)
6929 };
6930 let mut __struct = Self::default();
6931 __struct.time_utc = buf.get_u64_le();
6932 __struct.time_boot_ms = buf.get_u32_le();
6933 __struct.lat = buf.get_i32_le();
6934 __struct.lon = buf.get_i32_le();
6935 __struct.alt = buf.get_i32_le();
6936 __struct.relative_alt = buf.get_i32_le();
6937 for v in &mut __struct.q {
6938 let val = buf.get_f32_le();
6939 *v = val;
6940 }
6941 __struct.image_index = buf.get_i32_le();
6942 __struct.camera_id = buf.get_u8();
6943 __struct.capture_result = buf.get_i8();
6944 for v in &mut __struct.file_url {
6945 let val = buf.get_u8();
6946 *v = val;
6947 }
6948 Ok(__struct)
6949 }
6950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6951 let mut __tmp = BytesMut::new(bytes);
6952 #[allow(clippy::absurd_extreme_comparisons)]
6953 #[allow(unused_comparisons)]
6954 if __tmp.remaining() < Self::ENCODED_LEN {
6955 panic!(
6956 "buffer is too small (need {} bytes, but got {})",
6957 Self::ENCODED_LEN,
6958 __tmp.remaining(),
6959 )
6960 }
6961 __tmp.put_u64_le(self.time_utc);
6962 __tmp.put_u32_le(self.time_boot_ms);
6963 __tmp.put_i32_le(self.lat);
6964 __tmp.put_i32_le(self.lon);
6965 __tmp.put_i32_le(self.alt);
6966 __tmp.put_i32_le(self.relative_alt);
6967 for val in &self.q {
6968 __tmp.put_f32_le(*val);
6969 }
6970 __tmp.put_i32_le(self.image_index);
6971 __tmp.put_u8(self.camera_id);
6972 __tmp.put_i8(self.capture_result);
6973 for val in &self.file_url {
6974 __tmp.put_u8(*val);
6975 }
6976 if matches!(version, MavlinkVersion::V2) {
6977 let len = __tmp.len();
6978 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6979 } else {
6980 __tmp.len()
6981 }
6982 }
6983}
6984#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6985#[doc = ""]
6986#[doc = "ID: 259"]
6987#[derive(Debug, Clone, PartialEq)]
6988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6990pub struct CAMERA_INFORMATION_DATA {
6991 #[doc = "Timestamp (time since system boot)."]
6992 pub time_boot_ms: u32,
6993 #[doc = "0xff). Use 0 if not known."]
6994 pub firmware_version: u32,
6995 #[doc = "Focal length. Use NaN if not known."]
6996 pub focal_length: f32,
6997 #[doc = "Image sensor size horizontal. Use NaN if not known."]
6998 pub sensor_size_h: f32,
6999 #[doc = "Image sensor size vertical. Use NaN if not known."]
7000 pub sensor_size_v: f32,
7001 #[doc = "Bitmap of camera capability flags."]
7002 pub flags: CameraCapFlags,
7003 #[doc = "Horizontal image resolution. Use 0 if not known."]
7004 pub resolution_h: u16,
7005 #[doc = "Vertical image resolution. Use 0 if not known."]
7006 pub resolution_v: u16,
7007 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7008 pub cam_definition_version: u16,
7009 #[doc = "Name of the camera vendor"]
7010 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7011 pub vendor_name: [u8; 32],
7012 #[doc = "Name of the camera model"]
7013 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7014 pub model_name: [u8; 32],
7015 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7016 pub lens_id: u8,
7017 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7019 pub cam_definition_uri: [u8; 140],
7020 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7021 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7022 pub gimbal_device_id: u8,
7023 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7024 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7025 pub camera_device_id: u8,
7026}
7027impl CAMERA_INFORMATION_DATA {
7028 pub const ENCODED_LEN: usize = 237usize;
7029 pub const DEFAULT: Self = Self {
7030 time_boot_ms: 0_u32,
7031 firmware_version: 0_u32,
7032 focal_length: 0.0_f32,
7033 sensor_size_h: 0.0_f32,
7034 sensor_size_v: 0.0_f32,
7035 flags: CameraCapFlags::DEFAULT,
7036 resolution_h: 0_u16,
7037 resolution_v: 0_u16,
7038 cam_definition_version: 0_u16,
7039 vendor_name: [0_u8; 32usize],
7040 model_name: [0_u8; 32usize],
7041 lens_id: 0_u8,
7042 cam_definition_uri: [0_u8; 140usize],
7043 gimbal_device_id: 0_u8,
7044 camera_device_id: 0_u8,
7045 };
7046 #[cfg(feature = "arbitrary")]
7047 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7048 use arbitrary::{Arbitrary, Unstructured};
7049 let mut buf = [0u8; 1024];
7050 rng.fill_bytes(&mut buf);
7051 let mut unstructured = Unstructured::new(&buf);
7052 Self::arbitrary(&mut unstructured).unwrap_or_default()
7053 }
7054}
7055impl Default for CAMERA_INFORMATION_DATA {
7056 fn default() -> Self {
7057 Self::DEFAULT.clone()
7058 }
7059}
7060impl MessageData for CAMERA_INFORMATION_DATA {
7061 type Message = MavMessage;
7062 const ID: u32 = 259u32;
7063 const NAME: &'static str = "CAMERA_INFORMATION";
7064 const EXTRA_CRC: u8 = 92u8;
7065 const ENCODED_LEN: usize = 237usize;
7066 fn deser(
7067 _version: MavlinkVersion,
7068 __input: &[u8],
7069 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7070 let avail_len = __input.len();
7071 let mut payload_buf = [0; Self::ENCODED_LEN];
7072 let mut buf = if avail_len < Self::ENCODED_LEN {
7073 payload_buf[0..avail_len].copy_from_slice(__input);
7074 Bytes::new(&payload_buf)
7075 } else {
7076 Bytes::new(__input)
7077 };
7078 let mut __struct = Self::default();
7079 __struct.time_boot_ms = buf.get_u32_le();
7080 __struct.firmware_version = buf.get_u32_le();
7081 __struct.focal_length = buf.get_f32_le();
7082 __struct.sensor_size_h = buf.get_f32_le();
7083 __struct.sensor_size_v = buf.get_f32_le();
7084 let tmp = buf.get_u32_le();
7085 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7086 ::mavlink_core::error::ParserError::InvalidFlag {
7087 flag_type: "CameraCapFlags",
7088 value: tmp as u32,
7089 },
7090 )?;
7091 __struct.resolution_h = buf.get_u16_le();
7092 __struct.resolution_v = buf.get_u16_le();
7093 __struct.cam_definition_version = buf.get_u16_le();
7094 for v in &mut __struct.vendor_name {
7095 let val = buf.get_u8();
7096 *v = val;
7097 }
7098 for v in &mut __struct.model_name {
7099 let val = buf.get_u8();
7100 *v = val;
7101 }
7102 __struct.lens_id = buf.get_u8();
7103 for v in &mut __struct.cam_definition_uri {
7104 let val = buf.get_u8();
7105 *v = val;
7106 }
7107 __struct.gimbal_device_id = buf.get_u8();
7108 __struct.camera_device_id = buf.get_u8();
7109 Ok(__struct)
7110 }
7111 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7112 let mut __tmp = BytesMut::new(bytes);
7113 #[allow(clippy::absurd_extreme_comparisons)]
7114 #[allow(unused_comparisons)]
7115 if __tmp.remaining() < Self::ENCODED_LEN {
7116 panic!(
7117 "buffer is too small (need {} bytes, but got {})",
7118 Self::ENCODED_LEN,
7119 __tmp.remaining(),
7120 )
7121 }
7122 __tmp.put_u32_le(self.time_boot_ms);
7123 __tmp.put_u32_le(self.firmware_version);
7124 __tmp.put_f32_le(self.focal_length);
7125 __tmp.put_f32_le(self.sensor_size_h);
7126 __tmp.put_f32_le(self.sensor_size_v);
7127 __tmp.put_u32_le(self.flags.bits());
7128 __tmp.put_u16_le(self.resolution_h);
7129 __tmp.put_u16_le(self.resolution_v);
7130 __tmp.put_u16_le(self.cam_definition_version);
7131 for val in &self.vendor_name {
7132 __tmp.put_u8(*val);
7133 }
7134 for val in &self.model_name {
7135 __tmp.put_u8(*val);
7136 }
7137 __tmp.put_u8(self.lens_id);
7138 for val in &self.cam_definition_uri {
7139 __tmp.put_u8(*val);
7140 }
7141 if matches!(version, MavlinkVersion::V2) {
7142 __tmp.put_u8(self.gimbal_device_id);
7143 __tmp.put_u8(self.camera_device_id);
7144 let len = __tmp.len();
7145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7146 } else {
7147 __tmp.len()
7148 }
7149 }
7150}
7151#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7152#[doc = ""]
7153#[doc = "ID: 260"]
7154#[derive(Debug, Clone, PartialEq)]
7155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7157pub struct CAMERA_SETTINGS_DATA {
7158 #[doc = "Timestamp (time since system boot)."]
7159 pub time_boot_ms: u32,
7160 #[doc = "Camera mode"]
7161 pub mode_id: CameraMode,
7162 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7164 pub zoomLevel: f32,
7165 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7167 pub focusLevel: f32,
7168 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7169 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7170 pub camera_device_id: u8,
7171}
7172impl CAMERA_SETTINGS_DATA {
7173 pub const ENCODED_LEN: usize = 14usize;
7174 pub const DEFAULT: Self = Self {
7175 time_boot_ms: 0_u32,
7176 mode_id: CameraMode::DEFAULT,
7177 zoomLevel: 0.0_f32,
7178 focusLevel: 0.0_f32,
7179 camera_device_id: 0_u8,
7180 };
7181 #[cfg(feature = "arbitrary")]
7182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7183 use arbitrary::{Arbitrary, Unstructured};
7184 let mut buf = [0u8; 1024];
7185 rng.fill_bytes(&mut buf);
7186 let mut unstructured = Unstructured::new(&buf);
7187 Self::arbitrary(&mut unstructured).unwrap_or_default()
7188 }
7189}
7190impl Default for CAMERA_SETTINGS_DATA {
7191 fn default() -> Self {
7192 Self::DEFAULT.clone()
7193 }
7194}
7195impl MessageData for CAMERA_SETTINGS_DATA {
7196 type Message = MavMessage;
7197 const ID: u32 = 260u32;
7198 const NAME: &'static str = "CAMERA_SETTINGS";
7199 const EXTRA_CRC: u8 = 146u8;
7200 const ENCODED_LEN: usize = 14usize;
7201 fn deser(
7202 _version: MavlinkVersion,
7203 __input: &[u8],
7204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7205 let avail_len = __input.len();
7206 let mut payload_buf = [0; Self::ENCODED_LEN];
7207 let mut buf = if avail_len < Self::ENCODED_LEN {
7208 payload_buf[0..avail_len].copy_from_slice(__input);
7209 Bytes::new(&payload_buf)
7210 } else {
7211 Bytes::new(__input)
7212 };
7213 let mut __struct = Self::default();
7214 __struct.time_boot_ms = buf.get_u32_le();
7215 let tmp = buf.get_u8();
7216 __struct.mode_id =
7217 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7218 enum_type: "CameraMode",
7219 value: tmp as u32,
7220 })?;
7221 __struct.zoomLevel = buf.get_f32_le();
7222 __struct.focusLevel = buf.get_f32_le();
7223 __struct.camera_device_id = buf.get_u8();
7224 Ok(__struct)
7225 }
7226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7227 let mut __tmp = BytesMut::new(bytes);
7228 #[allow(clippy::absurd_extreme_comparisons)]
7229 #[allow(unused_comparisons)]
7230 if __tmp.remaining() < Self::ENCODED_LEN {
7231 panic!(
7232 "buffer is too small (need {} bytes, but got {})",
7233 Self::ENCODED_LEN,
7234 __tmp.remaining(),
7235 )
7236 }
7237 __tmp.put_u32_le(self.time_boot_ms);
7238 __tmp.put_u8(self.mode_id as u8);
7239 if matches!(version, MavlinkVersion::V2) {
7240 __tmp.put_f32_le(self.zoomLevel);
7241 __tmp.put_f32_le(self.focusLevel);
7242 __tmp.put_u8(self.camera_device_id);
7243 let len = __tmp.len();
7244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7245 } else {
7246 __tmp.len()
7247 }
7248 }
7249}
7250#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7251#[doc = ""]
7252#[doc = "ID: 277"]
7253#[derive(Debug, Clone, PartialEq)]
7254#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7256pub struct CAMERA_THERMAL_RANGE_DATA {
7257 #[doc = "Timestamp (time since system boot)."]
7258 pub time_boot_ms: u32,
7259 #[doc = "Temperature max."]
7260 pub max: f32,
7261 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7262 pub max_point_x: f32,
7263 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7264 pub max_point_y: f32,
7265 #[doc = "Temperature min."]
7266 pub min: f32,
7267 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7268 pub min_point_x: f32,
7269 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7270 pub min_point_y: f32,
7271 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7272 pub stream_id: u8,
7273 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7274 pub camera_device_id: u8,
7275}
7276impl CAMERA_THERMAL_RANGE_DATA {
7277 pub const ENCODED_LEN: usize = 30usize;
7278 pub const DEFAULT: Self = Self {
7279 time_boot_ms: 0_u32,
7280 max: 0.0_f32,
7281 max_point_x: 0.0_f32,
7282 max_point_y: 0.0_f32,
7283 min: 0.0_f32,
7284 min_point_x: 0.0_f32,
7285 min_point_y: 0.0_f32,
7286 stream_id: 0_u8,
7287 camera_device_id: 0_u8,
7288 };
7289 #[cfg(feature = "arbitrary")]
7290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7291 use arbitrary::{Arbitrary, Unstructured};
7292 let mut buf = [0u8; 1024];
7293 rng.fill_bytes(&mut buf);
7294 let mut unstructured = Unstructured::new(&buf);
7295 Self::arbitrary(&mut unstructured).unwrap_or_default()
7296 }
7297}
7298impl Default for CAMERA_THERMAL_RANGE_DATA {
7299 fn default() -> Self {
7300 Self::DEFAULT.clone()
7301 }
7302}
7303impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7304 type Message = MavMessage;
7305 const ID: u32 = 277u32;
7306 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7307 const EXTRA_CRC: u8 = 62u8;
7308 const ENCODED_LEN: usize = 30usize;
7309 fn deser(
7310 _version: MavlinkVersion,
7311 __input: &[u8],
7312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7313 let avail_len = __input.len();
7314 let mut payload_buf = [0; Self::ENCODED_LEN];
7315 let mut buf = if avail_len < Self::ENCODED_LEN {
7316 payload_buf[0..avail_len].copy_from_slice(__input);
7317 Bytes::new(&payload_buf)
7318 } else {
7319 Bytes::new(__input)
7320 };
7321 let mut __struct = Self::default();
7322 __struct.time_boot_ms = buf.get_u32_le();
7323 __struct.max = buf.get_f32_le();
7324 __struct.max_point_x = buf.get_f32_le();
7325 __struct.max_point_y = buf.get_f32_le();
7326 __struct.min = buf.get_f32_le();
7327 __struct.min_point_x = buf.get_f32_le();
7328 __struct.min_point_y = buf.get_f32_le();
7329 __struct.stream_id = buf.get_u8();
7330 __struct.camera_device_id = buf.get_u8();
7331 Ok(__struct)
7332 }
7333 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7334 let mut __tmp = BytesMut::new(bytes);
7335 #[allow(clippy::absurd_extreme_comparisons)]
7336 #[allow(unused_comparisons)]
7337 if __tmp.remaining() < Self::ENCODED_LEN {
7338 panic!(
7339 "buffer is too small (need {} bytes, but got {})",
7340 Self::ENCODED_LEN,
7341 __tmp.remaining(),
7342 )
7343 }
7344 __tmp.put_u32_le(self.time_boot_ms);
7345 __tmp.put_f32_le(self.max);
7346 __tmp.put_f32_le(self.max_point_x);
7347 __tmp.put_f32_le(self.max_point_y);
7348 __tmp.put_f32_le(self.min);
7349 __tmp.put_f32_le(self.min_point_x);
7350 __tmp.put_f32_le(self.min_point_y);
7351 __tmp.put_u8(self.stream_id);
7352 __tmp.put_u8(self.camera_device_id);
7353 if matches!(version, MavlinkVersion::V2) {
7354 let len = __tmp.len();
7355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7356 } else {
7357 __tmp.len()
7358 }
7359 }
7360}
7361#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7362#[doc = ""]
7363#[doc = "ID: 276"]
7364#[derive(Debug, Clone, PartialEq)]
7365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7367pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7368 #[doc = "Latitude of tracked object"]
7369 pub lat: i32,
7370 #[doc = "Longitude of tracked object"]
7371 pub lon: i32,
7372 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7373 pub alt: f32,
7374 #[doc = "Horizontal accuracy. NAN if unknown"]
7375 pub h_acc: f32,
7376 #[doc = "Vertical accuracy. NAN if unknown"]
7377 pub v_acc: f32,
7378 #[doc = "North velocity of tracked object. NAN if unknown"]
7379 pub vel_n: f32,
7380 #[doc = "East velocity of tracked object. NAN if unknown"]
7381 pub vel_e: f32,
7382 #[doc = "Down velocity of tracked object. NAN if unknown"]
7383 pub vel_d: f32,
7384 #[doc = "Velocity accuracy. NAN if unknown"]
7385 pub vel_acc: f32,
7386 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7387 pub dist: f32,
7388 #[doc = "Heading in radians, in NED. NAN if unknown"]
7389 pub hdg: f32,
7390 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7391 pub hdg_acc: f32,
7392 #[doc = "Current tracking status"]
7393 pub tracking_status: CameraTrackingStatusFlags,
7394 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7395 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7396 pub camera_device_id: u8,
7397}
7398impl CAMERA_TRACKING_GEO_STATUS_DATA {
7399 pub const ENCODED_LEN: usize = 50usize;
7400 pub const DEFAULT: Self = Self {
7401 lat: 0_i32,
7402 lon: 0_i32,
7403 alt: 0.0_f32,
7404 h_acc: 0.0_f32,
7405 v_acc: 0.0_f32,
7406 vel_n: 0.0_f32,
7407 vel_e: 0.0_f32,
7408 vel_d: 0.0_f32,
7409 vel_acc: 0.0_f32,
7410 dist: 0.0_f32,
7411 hdg: 0.0_f32,
7412 hdg_acc: 0.0_f32,
7413 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7414 camera_device_id: 0_u8,
7415 };
7416 #[cfg(feature = "arbitrary")]
7417 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7418 use arbitrary::{Arbitrary, Unstructured};
7419 let mut buf = [0u8; 1024];
7420 rng.fill_bytes(&mut buf);
7421 let mut unstructured = Unstructured::new(&buf);
7422 Self::arbitrary(&mut unstructured).unwrap_or_default()
7423 }
7424}
7425impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7426 fn default() -> Self {
7427 Self::DEFAULT.clone()
7428 }
7429}
7430impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7431 type Message = MavMessage;
7432 const ID: u32 = 276u32;
7433 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7434 const EXTRA_CRC: u8 = 18u8;
7435 const ENCODED_LEN: usize = 50usize;
7436 fn deser(
7437 _version: MavlinkVersion,
7438 __input: &[u8],
7439 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7440 let avail_len = __input.len();
7441 let mut payload_buf = [0; Self::ENCODED_LEN];
7442 let mut buf = if avail_len < Self::ENCODED_LEN {
7443 payload_buf[0..avail_len].copy_from_slice(__input);
7444 Bytes::new(&payload_buf)
7445 } else {
7446 Bytes::new(__input)
7447 };
7448 let mut __struct = Self::default();
7449 __struct.lat = buf.get_i32_le();
7450 __struct.lon = buf.get_i32_le();
7451 __struct.alt = buf.get_f32_le();
7452 __struct.h_acc = buf.get_f32_le();
7453 __struct.v_acc = buf.get_f32_le();
7454 __struct.vel_n = buf.get_f32_le();
7455 __struct.vel_e = buf.get_f32_le();
7456 __struct.vel_d = buf.get_f32_le();
7457 __struct.vel_acc = buf.get_f32_le();
7458 __struct.dist = buf.get_f32_le();
7459 __struct.hdg = buf.get_f32_le();
7460 __struct.hdg_acc = buf.get_f32_le();
7461 let tmp = buf.get_u8();
7462 __struct.tracking_status =
7463 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7464 enum_type: "CameraTrackingStatusFlags",
7465 value: tmp as u32,
7466 })?;
7467 __struct.camera_device_id = buf.get_u8();
7468 Ok(__struct)
7469 }
7470 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7471 let mut __tmp = BytesMut::new(bytes);
7472 #[allow(clippy::absurd_extreme_comparisons)]
7473 #[allow(unused_comparisons)]
7474 if __tmp.remaining() < Self::ENCODED_LEN {
7475 panic!(
7476 "buffer is too small (need {} bytes, but got {})",
7477 Self::ENCODED_LEN,
7478 __tmp.remaining(),
7479 )
7480 }
7481 __tmp.put_i32_le(self.lat);
7482 __tmp.put_i32_le(self.lon);
7483 __tmp.put_f32_le(self.alt);
7484 __tmp.put_f32_le(self.h_acc);
7485 __tmp.put_f32_le(self.v_acc);
7486 __tmp.put_f32_le(self.vel_n);
7487 __tmp.put_f32_le(self.vel_e);
7488 __tmp.put_f32_le(self.vel_d);
7489 __tmp.put_f32_le(self.vel_acc);
7490 __tmp.put_f32_le(self.dist);
7491 __tmp.put_f32_le(self.hdg);
7492 __tmp.put_f32_le(self.hdg_acc);
7493 __tmp.put_u8(self.tracking_status as u8);
7494 if matches!(version, MavlinkVersion::V2) {
7495 __tmp.put_u8(self.camera_device_id);
7496 let len = __tmp.len();
7497 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7498 } else {
7499 __tmp.len()
7500 }
7501 }
7502}
7503#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7504#[doc = ""]
7505#[doc = "ID: 275"]
7506#[derive(Debug, Clone, PartialEq)]
7507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7509pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7510 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7511 pub point_x: f32,
7512 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7513 pub point_y: f32,
7514 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7515 pub radius: f32,
7516 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7517 pub rec_top_x: f32,
7518 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7519 pub rec_top_y: f32,
7520 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7521 pub rec_bottom_x: f32,
7522 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7523 pub rec_bottom_y: f32,
7524 #[doc = "Current tracking status"]
7525 pub tracking_status: CameraTrackingStatusFlags,
7526 #[doc = "Current tracking mode"]
7527 pub tracking_mode: CameraTrackingMode,
7528 #[doc = "Defines location of target data"]
7529 pub target_data: CameraTrackingTargetData,
7530 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7531 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7532 pub camera_device_id: u8,
7533}
7534impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7535 pub const ENCODED_LEN: usize = 32usize;
7536 pub const DEFAULT: Self = Self {
7537 point_x: 0.0_f32,
7538 point_y: 0.0_f32,
7539 radius: 0.0_f32,
7540 rec_top_x: 0.0_f32,
7541 rec_top_y: 0.0_f32,
7542 rec_bottom_x: 0.0_f32,
7543 rec_bottom_y: 0.0_f32,
7544 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7545 tracking_mode: CameraTrackingMode::DEFAULT,
7546 target_data: CameraTrackingTargetData::DEFAULT,
7547 camera_device_id: 0_u8,
7548 };
7549 #[cfg(feature = "arbitrary")]
7550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7551 use arbitrary::{Arbitrary, Unstructured};
7552 let mut buf = [0u8; 1024];
7553 rng.fill_bytes(&mut buf);
7554 let mut unstructured = Unstructured::new(&buf);
7555 Self::arbitrary(&mut unstructured).unwrap_or_default()
7556 }
7557}
7558impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7559 fn default() -> Self {
7560 Self::DEFAULT.clone()
7561 }
7562}
7563impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7564 type Message = MavMessage;
7565 const ID: u32 = 275u32;
7566 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7567 const EXTRA_CRC: u8 = 126u8;
7568 const ENCODED_LEN: usize = 32usize;
7569 fn deser(
7570 _version: MavlinkVersion,
7571 __input: &[u8],
7572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7573 let avail_len = __input.len();
7574 let mut payload_buf = [0; Self::ENCODED_LEN];
7575 let mut buf = if avail_len < Self::ENCODED_LEN {
7576 payload_buf[0..avail_len].copy_from_slice(__input);
7577 Bytes::new(&payload_buf)
7578 } else {
7579 Bytes::new(__input)
7580 };
7581 let mut __struct = Self::default();
7582 __struct.point_x = buf.get_f32_le();
7583 __struct.point_y = buf.get_f32_le();
7584 __struct.radius = buf.get_f32_le();
7585 __struct.rec_top_x = buf.get_f32_le();
7586 __struct.rec_top_y = buf.get_f32_le();
7587 __struct.rec_bottom_x = buf.get_f32_le();
7588 __struct.rec_bottom_y = buf.get_f32_le();
7589 let tmp = buf.get_u8();
7590 __struct.tracking_status =
7591 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7592 enum_type: "CameraTrackingStatusFlags",
7593 value: tmp as u32,
7594 })?;
7595 let tmp = buf.get_u8();
7596 __struct.tracking_mode =
7597 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7598 enum_type: "CameraTrackingMode",
7599 value: tmp as u32,
7600 })?;
7601 let tmp = buf.get_u8();
7602 __struct.target_data =
7603 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7604 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7605 flag_type: "CameraTrackingTargetData",
7606 value: tmp as u32,
7607 })?;
7608 __struct.camera_device_id = buf.get_u8();
7609 Ok(__struct)
7610 }
7611 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7612 let mut __tmp = BytesMut::new(bytes);
7613 #[allow(clippy::absurd_extreme_comparisons)]
7614 #[allow(unused_comparisons)]
7615 if __tmp.remaining() < Self::ENCODED_LEN {
7616 panic!(
7617 "buffer is too small (need {} bytes, but got {})",
7618 Self::ENCODED_LEN,
7619 __tmp.remaining(),
7620 )
7621 }
7622 __tmp.put_f32_le(self.point_x);
7623 __tmp.put_f32_le(self.point_y);
7624 __tmp.put_f32_le(self.radius);
7625 __tmp.put_f32_le(self.rec_top_x);
7626 __tmp.put_f32_le(self.rec_top_y);
7627 __tmp.put_f32_le(self.rec_bottom_x);
7628 __tmp.put_f32_le(self.rec_bottom_y);
7629 __tmp.put_u8(self.tracking_status as u8);
7630 __tmp.put_u8(self.tracking_mode as u8);
7631 __tmp.put_u8(self.target_data.bits());
7632 if matches!(version, MavlinkVersion::V2) {
7633 __tmp.put_u8(self.camera_device_id);
7634 let len = __tmp.len();
7635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7636 } else {
7637 __tmp.len()
7638 }
7639 }
7640}
7641#[doc = "Camera-IMU triggering and synchronisation message."]
7642#[doc = ""]
7643#[doc = "ID: 112"]
7644#[derive(Debug, Clone, PartialEq)]
7645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7647pub struct CAMERA_TRIGGER_DATA {
7648 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7649 pub time_usec: u64,
7650 #[doc = "Image frame sequence"]
7651 pub seq: u32,
7652}
7653impl CAMERA_TRIGGER_DATA {
7654 pub const ENCODED_LEN: usize = 12usize;
7655 pub const DEFAULT: Self = Self {
7656 time_usec: 0_u64,
7657 seq: 0_u32,
7658 };
7659 #[cfg(feature = "arbitrary")]
7660 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7661 use arbitrary::{Arbitrary, Unstructured};
7662 let mut buf = [0u8; 1024];
7663 rng.fill_bytes(&mut buf);
7664 let mut unstructured = Unstructured::new(&buf);
7665 Self::arbitrary(&mut unstructured).unwrap_or_default()
7666 }
7667}
7668impl Default for CAMERA_TRIGGER_DATA {
7669 fn default() -> Self {
7670 Self::DEFAULT.clone()
7671 }
7672}
7673impl MessageData for CAMERA_TRIGGER_DATA {
7674 type Message = MavMessage;
7675 const ID: u32 = 112u32;
7676 const NAME: &'static str = "CAMERA_TRIGGER";
7677 const EXTRA_CRC: u8 = 174u8;
7678 const ENCODED_LEN: usize = 12usize;
7679 fn deser(
7680 _version: MavlinkVersion,
7681 __input: &[u8],
7682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7683 let avail_len = __input.len();
7684 let mut payload_buf = [0; Self::ENCODED_LEN];
7685 let mut buf = if avail_len < Self::ENCODED_LEN {
7686 payload_buf[0..avail_len].copy_from_slice(__input);
7687 Bytes::new(&payload_buf)
7688 } else {
7689 Bytes::new(__input)
7690 };
7691 let mut __struct = Self::default();
7692 __struct.time_usec = buf.get_u64_le();
7693 __struct.seq = buf.get_u32_le();
7694 Ok(__struct)
7695 }
7696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7697 let mut __tmp = BytesMut::new(bytes);
7698 #[allow(clippy::absurd_extreme_comparisons)]
7699 #[allow(unused_comparisons)]
7700 if __tmp.remaining() < Self::ENCODED_LEN {
7701 panic!(
7702 "buffer is too small (need {} bytes, but got {})",
7703 Self::ENCODED_LEN,
7704 __tmp.remaining(),
7705 )
7706 }
7707 __tmp.put_u64_le(self.time_usec);
7708 __tmp.put_u32_le(self.seq);
7709 if matches!(version, MavlinkVersion::V2) {
7710 let len = __tmp.len();
7711 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7712 } else {
7713 __tmp.len()
7714 }
7715 }
7716}
7717#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
7718#[doc = ""]
7719#[doc = "ID: 387"]
7720#[derive(Debug, Clone, PartialEq)]
7721#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7722#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7723pub struct CANFD_FRAME_DATA {
7724 #[doc = "Frame ID"]
7725 pub id: u32,
7726 #[doc = "System ID."]
7727 pub target_system: u8,
7728 #[doc = "Component ID."]
7729 pub target_component: u8,
7730 #[doc = "bus number"]
7731 pub bus: u8,
7732 #[doc = "Frame length"]
7733 pub len: u8,
7734 #[doc = "Frame data"]
7735 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7736 pub data: [u8; 64],
7737}
7738impl CANFD_FRAME_DATA {
7739 pub const ENCODED_LEN: usize = 72usize;
7740 pub const DEFAULT: Self = Self {
7741 id: 0_u32,
7742 target_system: 0_u8,
7743 target_component: 0_u8,
7744 bus: 0_u8,
7745 len: 0_u8,
7746 data: [0_u8; 64usize],
7747 };
7748 #[cfg(feature = "arbitrary")]
7749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7750 use arbitrary::{Arbitrary, Unstructured};
7751 let mut buf = [0u8; 1024];
7752 rng.fill_bytes(&mut buf);
7753 let mut unstructured = Unstructured::new(&buf);
7754 Self::arbitrary(&mut unstructured).unwrap_or_default()
7755 }
7756}
7757impl Default for CANFD_FRAME_DATA {
7758 fn default() -> Self {
7759 Self::DEFAULT.clone()
7760 }
7761}
7762impl MessageData for CANFD_FRAME_DATA {
7763 type Message = MavMessage;
7764 const ID: u32 = 387u32;
7765 const NAME: &'static str = "CANFD_FRAME";
7766 const EXTRA_CRC: u8 = 4u8;
7767 const ENCODED_LEN: usize = 72usize;
7768 fn deser(
7769 _version: MavlinkVersion,
7770 __input: &[u8],
7771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7772 let avail_len = __input.len();
7773 let mut payload_buf = [0; Self::ENCODED_LEN];
7774 let mut buf = if avail_len < Self::ENCODED_LEN {
7775 payload_buf[0..avail_len].copy_from_slice(__input);
7776 Bytes::new(&payload_buf)
7777 } else {
7778 Bytes::new(__input)
7779 };
7780 let mut __struct = Self::default();
7781 __struct.id = buf.get_u32_le();
7782 __struct.target_system = buf.get_u8();
7783 __struct.target_component = buf.get_u8();
7784 __struct.bus = buf.get_u8();
7785 __struct.len = buf.get_u8();
7786 for v in &mut __struct.data {
7787 let val = buf.get_u8();
7788 *v = val;
7789 }
7790 Ok(__struct)
7791 }
7792 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7793 let mut __tmp = BytesMut::new(bytes);
7794 #[allow(clippy::absurd_extreme_comparisons)]
7795 #[allow(unused_comparisons)]
7796 if __tmp.remaining() < Self::ENCODED_LEN {
7797 panic!(
7798 "buffer is too small (need {} bytes, but got {})",
7799 Self::ENCODED_LEN,
7800 __tmp.remaining(),
7801 )
7802 }
7803 __tmp.put_u32_le(self.id);
7804 __tmp.put_u8(self.target_system);
7805 __tmp.put_u8(self.target_component);
7806 __tmp.put_u8(self.bus);
7807 __tmp.put_u8(self.len);
7808 for val in &self.data {
7809 __tmp.put_u8(*val);
7810 }
7811 if matches!(version, MavlinkVersion::V2) {
7812 let len = __tmp.len();
7813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7814 } else {
7815 __tmp.len()
7816 }
7817 }
7818}
7819#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
7820#[doc = ""]
7821#[doc = "ID: 388"]
7822#[derive(Debug, Clone, PartialEq)]
7823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7825pub struct CAN_FILTER_MODIFY_DATA {
7826 #[doc = "filter IDs, length num_ids"]
7827 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7828 pub ids: [u16; 16],
7829 #[doc = "System ID."]
7830 pub target_system: u8,
7831 #[doc = "Component ID."]
7832 pub target_component: u8,
7833 #[doc = "bus number"]
7834 pub bus: u8,
7835 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
7836 pub operation: CanFilterOp,
7837 #[doc = "number of IDs in filter list"]
7838 pub num_ids: u8,
7839}
7840impl CAN_FILTER_MODIFY_DATA {
7841 pub const ENCODED_LEN: usize = 37usize;
7842 pub const DEFAULT: Self = Self {
7843 ids: [0_u16; 16usize],
7844 target_system: 0_u8,
7845 target_component: 0_u8,
7846 bus: 0_u8,
7847 operation: CanFilterOp::DEFAULT,
7848 num_ids: 0_u8,
7849 };
7850 #[cfg(feature = "arbitrary")]
7851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7852 use arbitrary::{Arbitrary, Unstructured};
7853 let mut buf = [0u8; 1024];
7854 rng.fill_bytes(&mut buf);
7855 let mut unstructured = Unstructured::new(&buf);
7856 Self::arbitrary(&mut unstructured).unwrap_or_default()
7857 }
7858}
7859impl Default for CAN_FILTER_MODIFY_DATA {
7860 fn default() -> Self {
7861 Self::DEFAULT.clone()
7862 }
7863}
7864impl MessageData for CAN_FILTER_MODIFY_DATA {
7865 type Message = MavMessage;
7866 const ID: u32 = 388u32;
7867 const NAME: &'static str = "CAN_FILTER_MODIFY";
7868 const EXTRA_CRC: u8 = 8u8;
7869 const ENCODED_LEN: usize = 37usize;
7870 fn deser(
7871 _version: MavlinkVersion,
7872 __input: &[u8],
7873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7874 let avail_len = __input.len();
7875 let mut payload_buf = [0; Self::ENCODED_LEN];
7876 let mut buf = if avail_len < Self::ENCODED_LEN {
7877 payload_buf[0..avail_len].copy_from_slice(__input);
7878 Bytes::new(&payload_buf)
7879 } else {
7880 Bytes::new(__input)
7881 };
7882 let mut __struct = Self::default();
7883 for v in &mut __struct.ids {
7884 let val = buf.get_u16_le();
7885 *v = val;
7886 }
7887 __struct.target_system = buf.get_u8();
7888 __struct.target_component = buf.get_u8();
7889 __struct.bus = buf.get_u8();
7890 let tmp = buf.get_u8();
7891 __struct.operation =
7892 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7893 enum_type: "CanFilterOp",
7894 value: tmp as u32,
7895 })?;
7896 __struct.num_ids = buf.get_u8();
7897 Ok(__struct)
7898 }
7899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7900 let mut __tmp = BytesMut::new(bytes);
7901 #[allow(clippy::absurd_extreme_comparisons)]
7902 #[allow(unused_comparisons)]
7903 if __tmp.remaining() < Self::ENCODED_LEN {
7904 panic!(
7905 "buffer is too small (need {} bytes, but got {})",
7906 Self::ENCODED_LEN,
7907 __tmp.remaining(),
7908 )
7909 }
7910 for val in &self.ids {
7911 __tmp.put_u16_le(*val);
7912 }
7913 __tmp.put_u8(self.target_system);
7914 __tmp.put_u8(self.target_component);
7915 __tmp.put_u8(self.bus);
7916 __tmp.put_u8(self.operation as u8);
7917 __tmp.put_u8(self.num_ids);
7918 if matches!(version, MavlinkVersion::V2) {
7919 let len = __tmp.len();
7920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7921 } else {
7922 __tmp.len()
7923 }
7924 }
7925}
7926#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
7927#[doc = ""]
7928#[doc = "ID: 386"]
7929#[derive(Debug, Clone, PartialEq)]
7930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7932pub struct CAN_FRAME_DATA {
7933 #[doc = "Frame ID"]
7934 pub id: u32,
7935 #[doc = "System ID."]
7936 pub target_system: u8,
7937 #[doc = "Component ID."]
7938 pub target_component: u8,
7939 #[doc = "Bus number"]
7940 pub bus: u8,
7941 #[doc = "Frame length"]
7942 pub len: u8,
7943 #[doc = "Frame data"]
7944 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7945 pub data: [u8; 8],
7946}
7947impl CAN_FRAME_DATA {
7948 pub const ENCODED_LEN: usize = 16usize;
7949 pub const DEFAULT: Self = Self {
7950 id: 0_u32,
7951 target_system: 0_u8,
7952 target_component: 0_u8,
7953 bus: 0_u8,
7954 len: 0_u8,
7955 data: [0_u8; 8usize],
7956 };
7957 #[cfg(feature = "arbitrary")]
7958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7959 use arbitrary::{Arbitrary, Unstructured};
7960 let mut buf = [0u8; 1024];
7961 rng.fill_bytes(&mut buf);
7962 let mut unstructured = Unstructured::new(&buf);
7963 Self::arbitrary(&mut unstructured).unwrap_or_default()
7964 }
7965}
7966impl Default for CAN_FRAME_DATA {
7967 fn default() -> Self {
7968 Self::DEFAULT.clone()
7969 }
7970}
7971impl MessageData for CAN_FRAME_DATA {
7972 type Message = MavMessage;
7973 const ID: u32 = 386u32;
7974 const NAME: &'static str = "CAN_FRAME";
7975 const EXTRA_CRC: u8 = 132u8;
7976 const ENCODED_LEN: usize = 16usize;
7977 fn deser(
7978 _version: MavlinkVersion,
7979 __input: &[u8],
7980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7981 let avail_len = __input.len();
7982 let mut payload_buf = [0; Self::ENCODED_LEN];
7983 let mut buf = if avail_len < Self::ENCODED_LEN {
7984 payload_buf[0..avail_len].copy_from_slice(__input);
7985 Bytes::new(&payload_buf)
7986 } else {
7987 Bytes::new(__input)
7988 };
7989 let mut __struct = Self::default();
7990 __struct.id = buf.get_u32_le();
7991 __struct.target_system = buf.get_u8();
7992 __struct.target_component = buf.get_u8();
7993 __struct.bus = buf.get_u8();
7994 __struct.len = buf.get_u8();
7995 for v in &mut __struct.data {
7996 let val = buf.get_u8();
7997 *v = val;
7998 }
7999 Ok(__struct)
8000 }
8001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8002 let mut __tmp = BytesMut::new(bytes);
8003 #[allow(clippy::absurd_extreme_comparisons)]
8004 #[allow(unused_comparisons)]
8005 if __tmp.remaining() < Self::ENCODED_LEN {
8006 panic!(
8007 "buffer is too small (need {} bytes, but got {})",
8008 Self::ENCODED_LEN,
8009 __tmp.remaining(),
8010 )
8011 }
8012 __tmp.put_u32_le(self.id);
8013 __tmp.put_u8(self.target_system);
8014 __tmp.put_u8(self.target_component);
8015 __tmp.put_u8(self.bus);
8016 __tmp.put_u8(self.len);
8017 for val in &self.data {
8018 __tmp.put_u8(*val);
8019 }
8020 if matches!(version, MavlinkVersion::V2) {
8021 let len = __tmp.len();
8022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8023 } else {
8024 __tmp.len()
8025 }
8026 }
8027}
8028#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8029#[doc = ""]
8030#[doc = "ID: 336"]
8031#[derive(Debug, Clone, PartialEq)]
8032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8034pub struct CELLULAR_CONFIG_DATA {
8035 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8036 pub enable_lte: u8,
8037 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8038 pub enable_pin: u8,
8039 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8040 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8041 pub pin: [u8; 16],
8042 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8043 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8044 pub new_pin: [u8; 16],
8045 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8046 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8047 pub apn: [u8; 32],
8048 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8049 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8050 pub puk: [u8; 16],
8051 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8052 pub roaming: u8,
8053 #[doc = "Message acceptance response (sent back to GS)."]
8054 pub response: CellularConfigResponse,
8055}
8056impl CELLULAR_CONFIG_DATA {
8057 pub const ENCODED_LEN: usize = 84usize;
8058 pub const DEFAULT: Self = Self {
8059 enable_lte: 0_u8,
8060 enable_pin: 0_u8,
8061 pin: [0_u8; 16usize],
8062 new_pin: [0_u8; 16usize],
8063 apn: [0_u8; 32usize],
8064 puk: [0_u8; 16usize],
8065 roaming: 0_u8,
8066 response: CellularConfigResponse::DEFAULT,
8067 };
8068 #[cfg(feature = "arbitrary")]
8069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8070 use arbitrary::{Arbitrary, Unstructured};
8071 let mut buf = [0u8; 1024];
8072 rng.fill_bytes(&mut buf);
8073 let mut unstructured = Unstructured::new(&buf);
8074 Self::arbitrary(&mut unstructured).unwrap_or_default()
8075 }
8076}
8077impl Default for CELLULAR_CONFIG_DATA {
8078 fn default() -> Self {
8079 Self::DEFAULT.clone()
8080 }
8081}
8082impl MessageData for CELLULAR_CONFIG_DATA {
8083 type Message = MavMessage;
8084 const ID: u32 = 336u32;
8085 const NAME: &'static str = "CELLULAR_CONFIG";
8086 const EXTRA_CRC: u8 = 245u8;
8087 const ENCODED_LEN: usize = 84usize;
8088 fn deser(
8089 _version: MavlinkVersion,
8090 __input: &[u8],
8091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8092 let avail_len = __input.len();
8093 let mut payload_buf = [0; Self::ENCODED_LEN];
8094 let mut buf = if avail_len < Self::ENCODED_LEN {
8095 payload_buf[0..avail_len].copy_from_slice(__input);
8096 Bytes::new(&payload_buf)
8097 } else {
8098 Bytes::new(__input)
8099 };
8100 let mut __struct = Self::default();
8101 __struct.enable_lte = buf.get_u8();
8102 __struct.enable_pin = buf.get_u8();
8103 for v in &mut __struct.pin {
8104 let val = buf.get_u8();
8105 *v = val;
8106 }
8107 for v in &mut __struct.new_pin {
8108 let val = buf.get_u8();
8109 *v = val;
8110 }
8111 for v in &mut __struct.apn {
8112 let val = buf.get_u8();
8113 *v = val;
8114 }
8115 for v in &mut __struct.puk {
8116 let val = buf.get_u8();
8117 *v = val;
8118 }
8119 __struct.roaming = buf.get_u8();
8120 let tmp = buf.get_u8();
8121 __struct.response =
8122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8123 enum_type: "CellularConfigResponse",
8124 value: tmp as u32,
8125 })?;
8126 Ok(__struct)
8127 }
8128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8129 let mut __tmp = BytesMut::new(bytes);
8130 #[allow(clippy::absurd_extreme_comparisons)]
8131 #[allow(unused_comparisons)]
8132 if __tmp.remaining() < Self::ENCODED_LEN {
8133 panic!(
8134 "buffer is too small (need {} bytes, but got {})",
8135 Self::ENCODED_LEN,
8136 __tmp.remaining(),
8137 )
8138 }
8139 __tmp.put_u8(self.enable_lte);
8140 __tmp.put_u8(self.enable_pin);
8141 for val in &self.pin {
8142 __tmp.put_u8(*val);
8143 }
8144 for val in &self.new_pin {
8145 __tmp.put_u8(*val);
8146 }
8147 for val in &self.apn {
8148 __tmp.put_u8(*val);
8149 }
8150 for val in &self.puk {
8151 __tmp.put_u8(*val);
8152 }
8153 __tmp.put_u8(self.roaming);
8154 __tmp.put_u8(self.response as u8);
8155 if matches!(version, MavlinkVersion::V2) {
8156 let len = __tmp.len();
8157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8158 } else {
8159 __tmp.len()
8160 }
8161 }
8162}
8163#[doc = "Report current used cellular network status."]
8164#[doc = ""]
8165#[doc = "ID: 334"]
8166#[derive(Debug, Clone, PartialEq)]
8167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8169pub struct CELLULAR_STATUS_DATA {
8170 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8171 pub mcc: u16,
8172 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8173 pub mnc: u16,
8174 #[doc = "Location area code. If unknown, set to 0"]
8175 pub lac: u16,
8176 #[doc = "Cellular modem status"]
8177 pub status: CellularStatusFlag,
8178 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8179 pub failure_reason: CellularNetworkFailedReason,
8180 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8181 pub mavtype: CellularNetworkRadioType,
8182 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8183 pub quality: u8,
8184}
8185impl CELLULAR_STATUS_DATA {
8186 pub const ENCODED_LEN: usize = 10usize;
8187 pub const DEFAULT: Self = Self {
8188 mcc: 0_u16,
8189 mnc: 0_u16,
8190 lac: 0_u16,
8191 status: CellularStatusFlag::DEFAULT,
8192 failure_reason: CellularNetworkFailedReason::DEFAULT,
8193 mavtype: CellularNetworkRadioType::DEFAULT,
8194 quality: 0_u8,
8195 };
8196 #[cfg(feature = "arbitrary")]
8197 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8198 use arbitrary::{Arbitrary, Unstructured};
8199 let mut buf = [0u8; 1024];
8200 rng.fill_bytes(&mut buf);
8201 let mut unstructured = Unstructured::new(&buf);
8202 Self::arbitrary(&mut unstructured).unwrap_or_default()
8203 }
8204}
8205impl Default for CELLULAR_STATUS_DATA {
8206 fn default() -> Self {
8207 Self::DEFAULT.clone()
8208 }
8209}
8210impl MessageData for CELLULAR_STATUS_DATA {
8211 type Message = MavMessage;
8212 const ID: u32 = 334u32;
8213 const NAME: &'static str = "CELLULAR_STATUS";
8214 const EXTRA_CRC: u8 = 72u8;
8215 const ENCODED_LEN: usize = 10usize;
8216 fn deser(
8217 _version: MavlinkVersion,
8218 __input: &[u8],
8219 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8220 let avail_len = __input.len();
8221 let mut payload_buf = [0; Self::ENCODED_LEN];
8222 let mut buf = if avail_len < Self::ENCODED_LEN {
8223 payload_buf[0..avail_len].copy_from_slice(__input);
8224 Bytes::new(&payload_buf)
8225 } else {
8226 Bytes::new(__input)
8227 };
8228 let mut __struct = Self::default();
8229 __struct.mcc = buf.get_u16_le();
8230 __struct.mnc = buf.get_u16_le();
8231 __struct.lac = buf.get_u16_le();
8232 let tmp = buf.get_u8();
8233 __struct.status =
8234 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8235 enum_type: "CellularStatusFlag",
8236 value: tmp as u32,
8237 })?;
8238 let tmp = buf.get_u8();
8239 __struct.failure_reason =
8240 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8241 enum_type: "CellularNetworkFailedReason",
8242 value: tmp as u32,
8243 })?;
8244 let tmp = buf.get_u8();
8245 __struct.mavtype =
8246 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8247 enum_type: "CellularNetworkRadioType",
8248 value: tmp as u32,
8249 })?;
8250 __struct.quality = buf.get_u8();
8251 Ok(__struct)
8252 }
8253 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8254 let mut __tmp = BytesMut::new(bytes);
8255 #[allow(clippy::absurd_extreme_comparisons)]
8256 #[allow(unused_comparisons)]
8257 if __tmp.remaining() < Self::ENCODED_LEN {
8258 panic!(
8259 "buffer is too small (need {} bytes, but got {})",
8260 Self::ENCODED_LEN,
8261 __tmp.remaining(),
8262 )
8263 }
8264 __tmp.put_u16_le(self.mcc);
8265 __tmp.put_u16_le(self.mnc);
8266 __tmp.put_u16_le(self.lac);
8267 __tmp.put_u8(self.status as u8);
8268 __tmp.put_u8(self.failure_reason as u8);
8269 __tmp.put_u8(self.mavtype as u8);
8270 __tmp.put_u8(self.quality);
8271 if matches!(version, MavlinkVersion::V2) {
8272 let len = __tmp.len();
8273 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8274 } else {
8275 __tmp.len()
8276 }
8277 }
8278}
8279#[doc = "Request to control this MAV."]
8280#[doc = ""]
8281#[doc = "ID: 5"]
8282#[derive(Debug, Clone, PartialEq)]
8283#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8284#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8285pub struct CHANGE_OPERATOR_CONTROL_DATA {
8286 #[doc = "System the GCS requests control for"]
8287 pub target_system: u8,
8288 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8289 pub control_request: u8,
8290 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8291 pub version: u8,
8292 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8293 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8294 pub passkey: [u8; 25],
8295}
8296impl CHANGE_OPERATOR_CONTROL_DATA {
8297 pub const ENCODED_LEN: usize = 28usize;
8298 pub const DEFAULT: Self = Self {
8299 target_system: 0_u8,
8300 control_request: 0_u8,
8301 version: 0_u8,
8302 passkey: [0_u8; 25usize],
8303 };
8304 #[cfg(feature = "arbitrary")]
8305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8306 use arbitrary::{Arbitrary, Unstructured};
8307 let mut buf = [0u8; 1024];
8308 rng.fill_bytes(&mut buf);
8309 let mut unstructured = Unstructured::new(&buf);
8310 Self::arbitrary(&mut unstructured).unwrap_or_default()
8311 }
8312}
8313impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8314 fn default() -> Self {
8315 Self::DEFAULT.clone()
8316 }
8317}
8318impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8319 type Message = MavMessage;
8320 const ID: u32 = 5u32;
8321 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8322 const EXTRA_CRC: u8 = 217u8;
8323 const ENCODED_LEN: usize = 28usize;
8324 fn deser(
8325 _version: MavlinkVersion,
8326 __input: &[u8],
8327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8328 let avail_len = __input.len();
8329 let mut payload_buf = [0; Self::ENCODED_LEN];
8330 let mut buf = if avail_len < Self::ENCODED_LEN {
8331 payload_buf[0..avail_len].copy_from_slice(__input);
8332 Bytes::new(&payload_buf)
8333 } else {
8334 Bytes::new(__input)
8335 };
8336 let mut __struct = Self::default();
8337 __struct.target_system = buf.get_u8();
8338 __struct.control_request = buf.get_u8();
8339 __struct.version = buf.get_u8();
8340 for v in &mut __struct.passkey {
8341 let val = buf.get_u8();
8342 *v = val;
8343 }
8344 Ok(__struct)
8345 }
8346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8347 let mut __tmp = BytesMut::new(bytes);
8348 #[allow(clippy::absurd_extreme_comparisons)]
8349 #[allow(unused_comparisons)]
8350 if __tmp.remaining() < Self::ENCODED_LEN {
8351 panic!(
8352 "buffer is too small (need {} bytes, but got {})",
8353 Self::ENCODED_LEN,
8354 __tmp.remaining(),
8355 )
8356 }
8357 __tmp.put_u8(self.target_system);
8358 __tmp.put_u8(self.control_request);
8359 __tmp.put_u8(self.version);
8360 for val in &self.passkey {
8361 __tmp.put_u8(*val);
8362 }
8363 if matches!(version, MavlinkVersion::V2) {
8364 let len = __tmp.len();
8365 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8366 } else {
8367 __tmp.len()
8368 }
8369 }
8370}
8371#[doc = "Accept / deny control of this MAV."]
8372#[doc = ""]
8373#[doc = "ID: 6"]
8374#[derive(Debug, Clone, PartialEq)]
8375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8377pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8378 #[doc = "ID of the GCS this message"]
8379 pub gcs_system_id: u8,
8380 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8381 pub control_request: u8,
8382 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8383 pub ack: u8,
8384}
8385impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8386 pub const ENCODED_LEN: usize = 3usize;
8387 pub const DEFAULT: Self = Self {
8388 gcs_system_id: 0_u8,
8389 control_request: 0_u8,
8390 ack: 0_u8,
8391 };
8392 #[cfg(feature = "arbitrary")]
8393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8394 use arbitrary::{Arbitrary, Unstructured};
8395 let mut buf = [0u8; 1024];
8396 rng.fill_bytes(&mut buf);
8397 let mut unstructured = Unstructured::new(&buf);
8398 Self::arbitrary(&mut unstructured).unwrap_or_default()
8399 }
8400}
8401impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8402 fn default() -> Self {
8403 Self::DEFAULT.clone()
8404 }
8405}
8406impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8407 type Message = MavMessage;
8408 const ID: u32 = 6u32;
8409 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8410 const EXTRA_CRC: u8 = 104u8;
8411 const ENCODED_LEN: usize = 3usize;
8412 fn deser(
8413 _version: MavlinkVersion,
8414 __input: &[u8],
8415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8416 let avail_len = __input.len();
8417 let mut payload_buf = [0; Self::ENCODED_LEN];
8418 let mut buf = if avail_len < Self::ENCODED_LEN {
8419 payload_buf[0..avail_len].copy_from_slice(__input);
8420 Bytes::new(&payload_buf)
8421 } else {
8422 Bytes::new(__input)
8423 };
8424 let mut __struct = Self::default();
8425 __struct.gcs_system_id = buf.get_u8();
8426 __struct.control_request = buf.get_u8();
8427 __struct.ack = buf.get_u8();
8428 Ok(__struct)
8429 }
8430 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8431 let mut __tmp = BytesMut::new(bytes);
8432 #[allow(clippy::absurd_extreme_comparisons)]
8433 #[allow(unused_comparisons)]
8434 if __tmp.remaining() < Self::ENCODED_LEN {
8435 panic!(
8436 "buffer is too small (need {} bytes, but got {})",
8437 Self::ENCODED_LEN,
8438 __tmp.remaining(),
8439 )
8440 }
8441 __tmp.put_u8(self.gcs_system_id);
8442 __tmp.put_u8(self.control_request);
8443 __tmp.put_u8(self.ack);
8444 if matches!(version, MavlinkVersion::V2) {
8445 let len = __tmp.len();
8446 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8447 } else {
8448 __tmp.len()
8449 }
8450 }
8451}
8452#[doc = "Information about a potential collision."]
8453#[doc = ""]
8454#[doc = "ID: 247"]
8455#[derive(Debug, Clone, PartialEq)]
8456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8457#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8458pub struct COLLISION_DATA {
8459 #[doc = "Unique identifier, domain based on src field"]
8460 pub id: u32,
8461 #[doc = "Estimated time until collision occurs"]
8462 pub time_to_minimum_delta: f32,
8463 #[doc = "Closest vertical distance between vehicle and object"]
8464 pub altitude_minimum_delta: f32,
8465 #[doc = "Closest horizontal distance between vehicle and object"]
8466 pub horizontal_minimum_delta: f32,
8467 #[doc = "Collision data source"]
8468 pub src: MavCollisionSrc,
8469 #[doc = "Action that is being taken to avoid this collision"]
8470 pub action: MavCollisionAction,
8471 #[doc = "How concerned the aircraft is about this collision"]
8472 pub threat_level: MavCollisionThreatLevel,
8473}
8474impl COLLISION_DATA {
8475 pub const ENCODED_LEN: usize = 19usize;
8476 pub const DEFAULT: Self = Self {
8477 id: 0_u32,
8478 time_to_minimum_delta: 0.0_f32,
8479 altitude_minimum_delta: 0.0_f32,
8480 horizontal_minimum_delta: 0.0_f32,
8481 src: MavCollisionSrc::DEFAULT,
8482 action: MavCollisionAction::DEFAULT,
8483 threat_level: MavCollisionThreatLevel::DEFAULT,
8484 };
8485 #[cfg(feature = "arbitrary")]
8486 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8487 use arbitrary::{Arbitrary, Unstructured};
8488 let mut buf = [0u8; 1024];
8489 rng.fill_bytes(&mut buf);
8490 let mut unstructured = Unstructured::new(&buf);
8491 Self::arbitrary(&mut unstructured).unwrap_or_default()
8492 }
8493}
8494impl Default for COLLISION_DATA {
8495 fn default() -> Self {
8496 Self::DEFAULT.clone()
8497 }
8498}
8499impl MessageData for COLLISION_DATA {
8500 type Message = MavMessage;
8501 const ID: u32 = 247u32;
8502 const NAME: &'static str = "COLLISION";
8503 const EXTRA_CRC: u8 = 81u8;
8504 const ENCODED_LEN: usize = 19usize;
8505 fn deser(
8506 _version: MavlinkVersion,
8507 __input: &[u8],
8508 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8509 let avail_len = __input.len();
8510 let mut payload_buf = [0; Self::ENCODED_LEN];
8511 let mut buf = if avail_len < Self::ENCODED_LEN {
8512 payload_buf[0..avail_len].copy_from_slice(__input);
8513 Bytes::new(&payload_buf)
8514 } else {
8515 Bytes::new(__input)
8516 };
8517 let mut __struct = Self::default();
8518 __struct.id = buf.get_u32_le();
8519 __struct.time_to_minimum_delta = buf.get_f32_le();
8520 __struct.altitude_minimum_delta = buf.get_f32_le();
8521 __struct.horizontal_minimum_delta = buf.get_f32_le();
8522 let tmp = buf.get_u8();
8523 __struct.src =
8524 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8525 enum_type: "MavCollisionSrc",
8526 value: tmp as u32,
8527 })?;
8528 let tmp = buf.get_u8();
8529 __struct.action =
8530 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8531 enum_type: "MavCollisionAction",
8532 value: tmp as u32,
8533 })?;
8534 let tmp = buf.get_u8();
8535 __struct.threat_level =
8536 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8537 enum_type: "MavCollisionThreatLevel",
8538 value: tmp as u32,
8539 })?;
8540 Ok(__struct)
8541 }
8542 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8543 let mut __tmp = BytesMut::new(bytes);
8544 #[allow(clippy::absurd_extreme_comparisons)]
8545 #[allow(unused_comparisons)]
8546 if __tmp.remaining() < Self::ENCODED_LEN {
8547 panic!(
8548 "buffer is too small (need {} bytes, but got {})",
8549 Self::ENCODED_LEN,
8550 __tmp.remaining(),
8551 )
8552 }
8553 __tmp.put_u32_le(self.id);
8554 __tmp.put_f32_le(self.time_to_minimum_delta);
8555 __tmp.put_f32_le(self.altitude_minimum_delta);
8556 __tmp.put_f32_le(self.horizontal_minimum_delta);
8557 __tmp.put_u8(self.src as u8);
8558 __tmp.put_u8(self.action as u8);
8559 __tmp.put_u8(self.threat_level as u8);
8560 if matches!(version, MavlinkVersion::V2) {
8561 let len = __tmp.len();
8562 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8563 } else {
8564 __tmp.len()
8565 }
8566 }
8567}
8568#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8569#[doc = ""]
8570#[doc = "ID: 77"]
8571#[derive(Debug, Clone, PartialEq)]
8572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8574pub struct COMMAND_ACK_DATA {
8575 #[doc = "Command ID (of acknowledged command)."]
8576 pub command: MavCmd,
8577 #[doc = "Result of command."]
8578 pub result: MavResult,
8579 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8580 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8581 pub progress: u8,
8582 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8583 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8584 pub result_param2: i32,
8585 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8586 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8587 pub target_system: u8,
8588 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8589 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8590 pub target_component: u8,
8591}
8592impl COMMAND_ACK_DATA {
8593 pub const ENCODED_LEN: usize = 10usize;
8594 pub const DEFAULT: Self = Self {
8595 command: MavCmd::DEFAULT,
8596 result: MavResult::DEFAULT,
8597 progress: 0_u8,
8598 result_param2: 0_i32,
8599 target_system: 0_u8,
8600 target_component: 0_u8,
8601 };
8602 #[cfg(feature = "arbitrary")]
8603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8604 use arbitrary::{Arbitrary, Unstructured};
8605 let mut buf = [0u8; 1024];
8606 rng.fill_bytes(&mut buf);
8607 let mut unstructured = Unstructured::new(&buf);
8608 Self::arbitrary(&mut unstructured).unwrap_or_default()
8609 }
8610}
8611impl Default for COMMAND_ACK_DATA {
8612 fn default() -> Self {
8613 Self::DEFAULT.clone()
8614 }
8615}
8616impl MessageData for COMMAND_ACK_DATA {
8617 type Message = MavMessage;
8618 const ID: u32 = 77u32;
8619 const NAME: &'static str = "COMMAND_ACK";
8620 const EXTRA_CRC: u8 = 143u8;
8621 const ENCODED_LEN: usize = 10usize;
8622 fn deser(
8623 _version: MavlinkVersion,
8624 __input: &[u8],
8625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8626 let avail_len = __input.len();
8627 let mut payload_buf = [0; Self::ENCODED_LEN];
8628 let mut buf = if avail_len < Self::ENCODED_LEN {
8629 payload_buf[0..avail_len].copy_from_slice(__input);
8630 Bytes::new(&payload_buf)
8631 } else {
8632 Bytes::new(__input)
8633 };
8634 let mut __struct = Self::default();
8635 let tmp = buf.get_u16_le();
8636 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8637 ::mavlink_core::error::ParserError::InvalidEnum {
8638 enum_type: "MavCmd",
8639 value: tmp as u32,
8640 },
8641 )?;
8642 let tmp = buf.get_u8();
8643 __struct.result =
8644 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8645 enum_type: "MavResult",
8646 value: tmp as u32,
8647 })?;
8648 __struct.progress = buf.get_u8();
8649 __struct.result_param2 = buf.get_i32_le();
8650 __struct.target_system = buf.get_u8();
8651 __struct.target_component = buf.get_u8();
8652 Ok(__struct)
8653 }
8654 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8655 let mut __tmp = BytesMut::new(bytes);
8656 #[allow(clippy::absurd_extreme_comparisons)]
8657 #[allow(unused_comparisons)]
8658 if __tmp.remaining() < Self::ENCODED_LEN {
8659 panic!(
8660 "buffer is too small (need {} bytes, but got {})",
8661 Self::ENCODED_LEN,
8662 __tmp.remaining(),
8663 )
8664 }
8665 __tmp.put_u16_le(self.command as u16);
8666 __tmp.put_u8(self.result as u8);
8667 if matches!(version, MavlinkVersion::V2) {
8668 __tmp.put_u8(self.progress);
8669 __tmp.put_i32_le(self.result_param2);
8670 __tmp.put_u8(self.target_system);
8671 __tmp.put_u8(self.target_component);
8672 let len = __tmp.len();
8673 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8674 } else {
8675 __tmp.len()
8676 }
8677 }
8678}
8679#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8680#[doc = ""]
8681#[doc = "ID: 80"]
8682#[derive(Debug, Clone, PartialEq)]
8683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8685pub struct COMMAND_CANCEL_DATA {
8686 #[doc = "Command ID (of command to cancel)."]
8687 pub command: MavCmd,
8688 #[doc = "System executing long running command. Should not be broadcast (0)."]
8689 pub target_system: u8,
8690 #[doc = "Component executing long running command."]
8691 pub target_component: u8,
8692}
8693impl COMMAND_CANCEL_DATA {
8694 pub const ENCODED_LEN: usize = 4usize;
8695 pub const DEFAULT: Self = Self {
8696 command: MavCmd::DEFAULT,
8697 target_system: 0_u8,
8698 target_component: 0_u8,
8699 };
8700 #[cfg(feature = "arbitrary")]
8701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8702 use arbitrary::{Arbitrary, Unstructured};
8703 let mut buf = [0u8; 1024];
8704 rng.fill_bytes(&mut buf);
8705 let mut unstructured = Unstructured::new(&buf);
8706 Self::arbitrary(&mut unstructured).unwrap_or_default()
8707 }
8708}
8709impl Default for COMMAND_CANCEL_DATA {
8710 fn default() -> Self {
8711 Self::DEFAULT.clone()
8712 }
8713}
8714impl MessageData for COMMAND_CANCEL_DATA {
8715 type Message = MavMessage;
8716 const ID: u32 = 80u32;
8717 const NAME: &'static str = "COMMAND_CANCEL";
8718 const EXTRA_CRC: u8 = 14u8;
8719 const ENCODED_LEN: usize = 4usize;
8720 fn deser(
8721 _version: MavlinkVersion,
8722 __input: &[u8],
8723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8724 let avail_len = __input.len();
8725 let mut payload_buf = [0; Self::ENCODED_LEN];
8726 let mut buf = if avail_len < Self::ENCODED_LEN {
8727 payload_buf[0..avail_len].copy_from_slice(__input);
8728 Bytes::new(&payload_buf)
8729 } else {
8730 Bytes::new(__input)
8731 };
8732 let mut __struct = Self::default();
8733 let tmp = buf.get_u16_le();
8734 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8735 ::mavlink_core::error::ParserError::InvalidEnum {
8736 enum_type: "MavCmd",
8737 value: tmp as u32,
8738 },
8739 )?;
8740 __struct.target_system = buf.get_u8();
8741 __struct.target_component = buf.get_u8();
8742 Ok(__struct)
8743 }
8744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8745 let mut __tmp = BytesMut::new(bytes);
8746 #[allow(clippy::absurd_extreme_comparisons)]
8747 #[allow(unused_comparisons)]
8748 if __tmp.remaining() < Self::ENCODED_LEN {
8749 panic!(
8750 "buffer is too small (need {} bytes, but got {})",
8751 Self::ENCODED_LEN,
8752 __tmp.remaining(),
8753 )
8754 }
8755 __tmp.put_u16_le(self.command as u16);
8756 __tmp.put_u8(self.target_system);
8757 __tmp.put_u8(self.target_component);
8758 if matches!(version, MavlinkVersion::V2) {
8759 let len = __tmp.len();
8760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8761 } else {
8762 __tmp.len()
8763 }
8764 }
8765}
8766#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8767#[doc = ""]
8768#[doc = "ID: 75"]
8769#[derive(Debug, Clone, PartialEq)]
8770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8772pub struct COMMAND_INT_DATA {
8773 #[doc = "PARAM1, see MAV_CMD enum"]
8774 pub param1: f32,
8775 #[doc = "PARAM2, see MAV_CMD enum"]
8776 pub param2: f32,
8777 #[doc = "PARAM3, see MAV_CMD enum"]
8778 pub param3: f32,
8779 #[doc = "PARAM4, see MAV_CMD enum"]
8780 pub param4: f32,
8781 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
8782 pub x: i32,
8783 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
8784 pub y: i32,
8785 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
8786 pub z: f32,
8787 #[doc = "The scheduled action for the mission item."]
8788 pub command: MavCmd,
8789 #[doc = "System ID"]
8790 pub target_system: u8,
8791 #[doc = "Component ID"]
8792 pub target_component: u8,
8793 #[doc = "The coordinate system of the COMMAND."]
8794 pub frame: MavFrame,
8795 #[doc = "Not used."]
8796 pub current: u8,
8797 #[doc = "Not used (set 0)."]
8798 pub autocontinue: u8,
8799}
8800impl COMMAND_INT_DATA {
8801 pub const ENCODED_LEN: usize = 35usize;
8802 pub const DEFAULT: Self = Self {
8803 param1: 0.0_f32,
8804 param2: 0.0_f32,
8805 param3: 0.0_f32,
8806 param4: 0.0_f32,
8807 x: 0_i32,
8808 y: 0_i32,
8809 z: 0.0_f32,
8810 command: MavCmd::DEFAULT,
8811 target_system: 0_u8,
8812 target_component: 0_u8,
8813 frame: MavFrame::DEFAULT,
8814 current: 0_u8,
8815 autocontinue: 0_u8,
8816 };
8817 #[cfg(feature = "arbitrary")]
8818 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8819 use arbitrary::{Arbitrary, Unstructured};
8820 let mut buf = [0u8; 1024];
8821 rng.fill_bytes(&mut buf);
8822 let mut unstructured = Unstructured::new(&buf);
8823 Self::arbitrary(&mut unstructured).unwrap_or_default()
8824 }
8825}
8826impl Default for COMMAND_INT_DATA {
8827 fn default() -> Self {
8828 Self::DEFAULT.clone()
8829 }
8830}
8831impl MessageData for COMMAND_INT_DATA {
8832 type Message = MavMessage;
8833 const ID: u32 = 75u32;
8834 const NAME: &'static str = "COMMAND_INT";
8835 const EXTRA_CRC: u8 = 158u8;
8836 const ENCODED_LEN: usize = 35usize;
8837 fn deser(
8838 _version: MavlinkVersion,
8839 __input: &[u8],
8840 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8841 let avail_len = __input.len();
8842 let mut payload_buf = [0; Self::ENCODED_LEN];
8843 let mut buf = if avail_len < Self::ENCODED_LEN {
8844 payload_buf[0..avail_len].copy_from_slice(__input);
8845 Bytes::new(&payload_buf)
8846 } else {
8847 Bytes::new(__input)
8848 };
8849 let mut __struct = Self::default();
8850 __struct.param1 = buf.get_f32_le();
8851 __struct.param2 = buf.get_f32_le();
8852 __struct.param3 = buf.get_f32_le();
8853 __struct.param4 = buf.get_f32_le();
8854 __struct.x = buf.get_i32_le();
8855 __struct.y = buf.get_i32_le();
8856 __struct.z = buf.get_f32_le();
8857 let tmp = buf.get_u16_le();
8858 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8859 ::mavlink_core::error::ParserError::InvalidEnum {
8860 enum_type: "MavCmd",
8861 value: tmp as u32,
8862 },
8863 )?;
8864 __struct.target_system = buf.get_u8();
8865 __struct.target_component = buf.get_u8();
8866 let tmp = buf.get_u8();
8867 __struct.frame =
8868 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8869 enum_type: "MavFrame",
8870 value: tmp as u32,
8871 })?;
8872 __struct.current = buf.get_u8();
8873 __struct.autocontinue = buf.get_u8();
8874 Ok(__struct)
8875 }
8876 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8877 let mut __tmp = BytesMut::new(bytes);
8878 #[allow(clippy::absurd_extreme_comparisons)]
8879 #[allow(unused_comparisons)]
8880 if __tmp.remaining() < Self::ENCODED_LEN {
8881 panic!(
8882 "buffer is too small (need {} bytes, but got {})",
8883 Self::ENCODED_LEN,
8884 __tmp.remaining(),
8885 )
8886 }
8887 __tmp.put_f32_le(self.param1);
8888 __tmp.put_f32_le(self.param2);
8889 __tmp.put_f32_le(self.param3);
8890 __tmp.put_f32_le(self.param4);
8891 __tmp.put_i32_le(self.x);
8892 __tmp.put_i32_le(self.y);
8893 __tmp.put_f32_le(self.z);
8894 __tmp.put_u16_le(self.command as u16);
8895 __tmp.put_u8(self.target_system);
8896 __tmp.put_u8(self.target_component);
8897 __tmp.put_u8(self.frame as u8);
8898 __tmp.put_u8(self.current);
8899 __tmp.put_u8(self.autocontinue);
8900 if matches!(version, MavlinkVersion::V2) {
8901 let len = __tmp.len();
8902 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8903 } else {
8904 __tmp.len()
8905 }
8906 }
8907}
8908#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8909#[doc = ""]
8910#[doc = "ID: 76"]
8911#[derive(Debug, Clone, PartialEq)]
8912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8914pub struct COMMAND_LONG_DATA {
8915 #[doc = "Parameter 1 (for the specific command)."]
8916 pub param1: f32,
8917 #[doc = "Parameter 2 (for the specific command)."]
8918 pub param2: f32,
8919 #[doc = "Parameter 3 (for the specific command)."]
8920 pub param3: f32,
8921 #[doc = "Parameter 4 (for the specific command)."]
8922 pub param4: f32,
8923 #[doc = "Parameter 5 (for the specific command)."]
8924 pub param5: f32,
8925 #[doc = "Parameter 6 (for the specific command)."]
8926 pub param6: f32,
8927 #[doc = "Parameter 7 (for the specific command)."]
8928 pub param7: f32,
8929 #[doc = "Command ID (of command to send)."]
8930 pub command: MavCmd,
8931 #[doc = "System which should execute the command"]
8932 pub target_system: u8,
8933 #[doc = "Component which should execute the command, 0 for all components"]
8934 pub target_component: u8,
8935 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
8936 pub confirmation: u8,
8937}
8938impl COMMAND_LONG_DATA {
8939 pub const ENCODED_LEN: usize = 33usize;
8940 pub const DEFAULT: Self = Self {
8941 param1: 0.0_f32,
8942 param2: 0.0_f32,
8943 param3: 0.0_f32,
8944 param4: 0.0_f32,
8945 param5: 0.0_f32,
8946 param6: 0.0_f32,
8947 param7: 0.0_f32,
8948 command: MavCmd::DEFAULT,
8949 target_system: 0_u8,
8950 target_component: 0_u8,
8951 confirmation: 0_u8,
8952 };
8953 #[cfg(feature = "arbitrary")]
8954 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8955 use arbitrary::{Arbitrary, Unstructured};
8956 let mut buf = [0u8; 1024];
8957 rng.fill_bytes(&mut buf);
8958 let mut unstructured = Unstructured::new(&buf);
8959 Self::arbitrary(&mut unstructured).unwrap_or_default()
8960 }
8961}
8962impl Default for COMMAND_LONG_DATA {
8963 fn default() -> Self {
8964 Self::DEFAULT.clone()
8965 }
8966}
8967impl MessageData for COMMAND_LONG_DATA {
8968 type Message = MavMessage;
8969 const ID: u32 = 76u32;
8970 const NAME: &'static str = "COMMAND_LONG";
8971 const EXTRA_CRC: u8 = 152u8;
8972 const ENCODED_LEN: usize = 33usize;
8973 fn deser(
8974 _version: MavlinkVersion,
8975 __input: &[u8],
8976 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8977 let avail_len = __input.len();
8978 let mut payload_buf = [0; Self::ENCODED_LEN];
8979 let mut buf = if avail_len < Self::ENCODED_LEN {
8980 payload_buf[0..avail_len].copy_from_slice(__input);
8981 Bytes::new(&payload_buf)
8982 } else {
8983 Bytes::new(__input)
8984 };
8985 let mut __struct = Self::default();
8986 __struct.param1 = buf.get_f32_le();
8987 __struct.param2 = buf.get_f32_le();
8988 __struct.param3 = buf.get_f32_le();
8989 __struct.param4 = buf.get_f32_le();
8990 __struct.param5 = buf.get_f32_le();
8991 __struct.param6 = buf.get_f32_le();
8992 __struct.param7 = buf.get_f32_le();
8993 let tmp = buf.get_u16_le();
8994 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8995 ::mavlink_core::error::ParserError::InvalidEnum {
8996 enum_type: "MavCmd",
8997 value: tmp as u32,
8998 },
8999 )?;
9000 __struct.target_system = buf.get_u8();
9001 __struct.target_component = buf.get_u8();
9002 __struct.confirmation = buf.get_u8();
9003 Ok(__struct)
9004 }
9005 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9006 let mut __tmp = BytesMut::new(bytes);
9007 #[allow(clippy::absurd_extreme_comparisons)]
9008 #[allow(unused_comparisons)]
9009 if __tmp.remaining() < Self::ENCODED_LEN {
9010 panic!(
9011 "buffer is too small (need {} bytes, but got {})",
9012 Self::ENCODED_LEN,
9013 __tmp.remaining(),
9014 )
9015 }
9016 __tmp.put_f32_le(self.param1);
9017 __tmp.put_f32_le(self.param2);
9018 __tmp.put_f32_le(self.param3);
9019 __tmp.put_f32_le(self.param4);
9020 __tmp.put_f32_le(self.param5);
9021 __tmp.put_f32_le(self.param6);
9022 __tmp.put_f32_le(self.param7);
9023 __tmp.put_u16_le(self.command as u16);
9024 __tmp.put_u8(self.target_system);
9025 __tmp.put_u8(self.target_component);
9026 __tmp.put_u8(self.confirmation);
9027 if matches!(version, MavlinkVersion::V2) {
9028 let len = __tmp.len();
9029 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9030 } else {
9031 __tmp.len()
9032 }
9033 }
9034}
9035#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9036#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9037#[doc = ""]
9038#[doc = "ID: 395"]
9039#[derive(Debug, Clone, PartialEq)]
9040#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9042pub struct COMPONENT_INFORMATION_DATA {
9043 #[doc = "Timestamp (time since system boot)."]
9044 pub time_boot_ms: u32,
9045 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9046 pub general_metadata_file_crc: u32,
9047 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9048 pub peripherals_metadata_file_crc: u32,
9049 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9051 pub general_metadata_uri: [u8; 100],
9052 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9054 pub peripherals_metadata_uri: [u8; 100],
9055}
9056impl COMPONENT_INFORMATION_DATA {
9057 pub const ENCODED_LEN: usize = 212usize;
9058 pub const DEFAULT: Self = Self {
9059 time_boot_ms: 0_u32,
9060 general_metadata_file_crc: 0_u32,
9061 peripherals_metadata_file_crc: 0_u32,
9062 general_metadata_uri: [0_u8; 100usize],
9063 peripherals_metadata_uri: [0_u8; 100usize],
9064 };
9065 #[cfg(feature = "arbitrary")]
9066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9067 use arbitrary::{Arbitrary, Unstructured};
9068 let mut buf = [0u8; 1024];
9069 rng.fill_bytes(&mut buf);
9070 let mut unstructured = Unstructured::new(&buf);
9071 Self::arbitrary(&mut unstructured).unwrap_or_default()
9072 }
9073}
9074impl Default for COMPONENT_INFORMATION_DATA {
9075 fn default() -> Self {
9076 Self::DEFAULT.clone()
9077 }
9078}
9079impl MessageData for COMPONENT_INFORMATION_DATA {
9080 type Message = MavMessage;
9081 const ID: u32 = 395u32;
9082 const NAME: &'static str = "COMPONENT_INFORMATION";
9083 const EXTRA_CRC: u8 = 0u8;
9084 const ENCODED_LEN: usize = 212usize;
9085 fn deser(
9086 _version: MavlinkVersion,
9087 __input: &[u8],
9088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9089 let avail_len = __input.len();
9090 let mut payload_buf = [0; Self::ENCODED_LEN];
9091 let mut buf = if avail_len < Self::ENCODED_LEN {
9092 payload_buf[0..avail_len].copy_from_slice(__input);
9093 Bytes::new(&payload_buf)
9094 } else {
9095 Bytes::new(__input)
9096 };
9097 let mut __struct = Self::default();
9098 __struct.time_boot_ms = buf.get_u32_le();
9099 __struct.general_metadata_file_crc = buf.get_u32_le();
9100 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9101 for v in &mut __struct.general_metadata_uri {
9102 let val = buf.get_u8();
9103 *v = val;
9104 }
9105 for v in &mut __struct.peripherals_metadata_uri {
9106 let val = buf.get_u8();
9107 *v = val;
9108 }
9109 Ok(__struct)
9110 }
9111 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9112 let mut __tmp = BytesMut::new(bytes);
9113 #[allow(clippy::absurd_extreme_comparisons)]
9114 #[allow(unused_comparisons)]
9115 if __tmp.remaining() < Self::ENCODED_LEN {
9116 panic!(
9117 "buffer is too small (need {} bytes, but got {})",
9118 Self::ENCODED_LEN,
9119 __tmp.remaining(),
9120 )
9121 }
9122 __tmp.put_u32_le(self.time_boot_ms);
9123 __tmp.put_u32_le(self.general_metadata_file_crc);
9124 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9125 for val in &self.general_metadata_uri {
9126 __tmp.put_u8(*val);
9127 }
9128 for val in &self.peripherals_metadata_uri {
9129 __tmp.put_u8(*val);
9130 }
9131 if matches!(version, MavlinkVersion::V2) {
9132 let len = __tmp.len();
9133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9134 } else {
9135 __tmp.len()
9136 }
9137 }
9138}
9139#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9140#[doc = ""]
9141#[doc = "ID: 396"]
9142#[derive(Debug, Clone, PartialEq)]
9143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9145pub struct COMPONENT_INFORMATION_BASIC_DATA {
9146 #[doc = "Component capability flags"]
9147 pub capabilities: MavProtocolCapability,
9148 #[doc = "Timestamp (time since system boot)."]
9149 pub time_boot_ms: u32,
9150 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9151 pub time_manufacture_s: u32,
9152 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9153 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9154 pub vendor_name: [u8; 32],
9155 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9156 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9157 pub model_name: [u8; 32],
9158 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9159 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9160 pub software_version: [u8; 24],
9161 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9162 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9163 pub hardware_version: [u8; 24],
9164 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9165 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9166 pub serial_number: [u8; 32],
9167}
9168impl COMPONENT_INFORMATION_BASIC_DATA {
9169 pub const ENCODED_LEN: usize = 160usize;
9170 pub const DEFAULT: Self = Self {
9171 capabilities: MavProtocolCapability::DEFAULT,
9172 time_boot_ms: 0_u32,
9173 time_manufacture_s: 0_u32,
9174 vendor_name: [0_u8; 32usize],
9175 model_name: [0_u8; 32usize],
9176 software_version: [0_u8; 24usize],
9177 hardware_version: [0_u8; 24usize],
9178 serial_number: [0_u8; 32usize],
9179 };
9180 #[cfg(feature = "arbitrary")]
9181 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9182 use arbitrary::{Arbitrary, Unstructured};
9183 let mut buf = [0u8; 1024];
9184 rng.fill_bytes(&mut buf);
9185 let mut unstructured = Unstructured::new(&buf);
9186 Self::arbitrary(&mut unstructured).unwrap_or_default()
9187 }
9188}
9189impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9190 fn default() -> Self {
9191 Self::DEFAULT.clone()
9192 }
9193}
9194impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9195 type Message = MavMessage;
9196 const ID: u32 = 396u32;
9197 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9198 const EXTRA_CRC: u8 = 50u8;
9199 const ENCODED_LEN: usize = 160usize;
9200 fn deser(
9201 _version: MavlinkVersion,
9202 __input: &[u8],
9203 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9204 let avail_len = __input.len();
9205 let mut payload_buf = [0; Self::ENCODED_LEN];
9206 let mut buf = if avail_len < Self::ENCODED_LEN {
9207 payload_buf[0..avail_len].copy_from_slice(__input);
9208 Bytes::new(&payload_buf)
9209 } else {
9210 Bytes::new(__input)
9211 };
9212 let mut __struct = Self::default();
9213 let tmp = buf.get_u64_le();
9214 __struct.capabilities = MavProtocolCapability::from_bits(
9215 tmp & MavProtocolCapability::all().bits(),
9216 )
9217 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9218 flag_type: "MavProtocolCapability",
9219 value: tmp as u32,
9220 })?;
9221 __struct.time_boot_ms = buf.get_u32_le();
9222 __struct.time_manufacture_s = buf.get_u32_le();
9223 for v in &mut __struct.vendor_name {
9224 let val = buf.get_u8();
9225 *v = val;
9226 }
9227 for v in &mut __struct.model_name {
9228 let val = buf.get_u8();
9229 *v = val;
9230 }
9231 for v in &mut __struct.software_version {
9232 let val = buf.get_u8();
9233 *v = val;
9234 }
9235 for v in &mut __struct.hardware_version {
9236 let val = buf.get_u8();
9237 *v = val;
9238 }
9239 for v in &mut __struct.serial_number {
9240 let val = buf.get_u8();
9241 *v = val;
9242 }
9243 Ok(__struct)
9244 }
9245 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9246 let mut __tmp = BytesMut::new(bytes);
9247 #[allow(clippy::absurd_extreme_comparisons)]
9248 #[allow(unused_comparisons)]
9249 if __tmp.remaining() < Self::ENCODED_LEN {
9250 panic!(
9251 "buffer is too small (need {} bytes, but got {})",
9252 Self::ENCODED_LEN,
9253 __tmp.remaining(),
9254 )
9255 }
9256 __tmp.put_u64_le(self.capabilities.bits());
9257 __tmp.put_u32_le(self.time_boot_ms);
9258 __tmp.put_u32_le(self.time_manufacture_s);
9259 for val in &self.vendor_name {
9260 __tmp.put_u8(*val);
9261 }
9262 for val in &self.model_name {
9263 __tmp.put_u8(*val);
9264 }
9265 for val in &self.software_version {
9266 __tmp.put_u8(*val);
9267 }
9268 for val in &self.hardware_version {
9269 __tmp.put_u8(*val);
9270 }
9271 for val in &self.serial_number {
9272 __tmp.put_u8(*val);
9273 }
9274 if matches!(version, MavlinkVersion::V2) {
9275 let len = __tmp.len();
9276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9277 } else {
9278 __tmp.len()
9279 }
9280 }
9281}
9282#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9283#[doc = ""]
9284#[doc = "ID: 397"]
9285#[derive(Debug, Clone, PartialEq)]
9286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9288pub struct COMPONENT_METADATA_DATA {
9289 #[doc = "Timestamp (time since system boot)."]
9290 pub time_boot_ms: u32,
9291 #[doc = "CRC32 of the general metadata file."]
9292 pub file_crc: u32,
9293 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9294 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9295 pub uri: [u8; 100],
9296}
9297impl COMPONENT_METADATA_DATA {
9298 pub const ENCODED_LEN: usize = 108usize;
9299 pub const DEFAULT: Self = Self {
9300 time_boot_ms: 0_u32,
9301 file_crc: 0_u32,
9302 uri: [0_u8; 100usize],
9303 };
9304 #[cfg(feature = "arbitrary")]
9305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9306 use arbitrary::{Arbitrary, Unstructured};
9307 let mut buf = [0u8; 1024];
9308 rng.fill_bytes(&mut buf);
9309 let mut unstructured = Unstructured::new(&buf);
9310 Self::arbitrary(&mut unstructured).unwrap_or_default()
9311 }
9312}
9313impl Default for COMPONENT_METADATA_DATA {
9314 fn default() -> Self {
9315 Self::DEFAULT.clone()
9316 }
9317}
9318impl MessageData for COMPONENT_METADATA_DATA {
9319 type Message = MavMessage;
9320 const ID: u32 = 397u32;
9321 const NAME: &'static str = "COMPONENT_METADATA";
9322 const EXTRA_CRC: u8 = 182u8;
9323 const ENCODED_LEN: usize = 108usize;
9324 fn deser(
9325 _version: MavlinkVersion,
9326 __input: &[u8],
9327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9328 let avail_len = __input.len();
9329 let mut payload_buf = [0; Self::ENCODED_LEN];
9330 let mut buf = if avail_len < Self::ENCODED_LEN {
9331 payload_buf[0..avail_len].copy_from_slice(__input);
9332 Bytes::new(&payload_buf)
9333 } else {
9334 Bytes::new(__input)
9335 };
9336 let mut __struct = Self::default();
9337 __struct.time_boot_ms = buf.get_u32_le();
9338 __struct.file_crc = buf.get_u32_le();
9339 for v in &mut __struct.uri {
9340 let val = buf.get_u8();
9341 *v = val;
9342 }
9343 Ok(__struct)
9344 }
9345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9346 let mut __tmp = BytesMut::new(bytes);
9347 #[allow(clippy::absurd_extreme_comparisons)]
9348 #[allow(unused_comparisons)]
9349 if __tmp.remaining() < Self::ENCODED_LEN {
9350 panic!(
9351 "buffer is too small (need {} bytes, but got {})",
9352 Self::ENCODED_LEN,
9353 __tmp.remaining(),
9354 )
9355 }
9356 __tmp.put_u32_le(self.time_boot_ms);
9357 __tmp.put_u32_le(self.file_crc);
9358 for val in &self.uri {
9359 __tmp.put_u8(*val);
9360 }
9361 if matches!(version, MavlinkVersion::V2) {
9362 let len = __tmp.len();
9363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9364 } else {
9365 __tmp.len()
9366 }
9367 }
9368}
9369#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9370#[doc = ""]
9371#[doc = "ID: 146"]
9372#[derive(Debug, Clone, PartialEq)]
9373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9375pub struct CONTROL_SYSTEM_STATE_DATA {
9376 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9377 pub time_usec: u64,
9378 #[doc = "X acceleration in body frame"]
9379 pub x_acc: f32,
9380 #[doc = "Y acceleration in body frame"]
9381 pub y_acc: f32,
9382 #[doc = "Z acceleration in body frame"]
9383 pub z_acc: f32,
9384 #[doc = "X velocity in body frame"]
9385 pub x_vel: f32,
9386 #[doc = "Y velocity in body frame"]
9387 pub y_vel: f32,
9388 #[doc = "Z velocity in body frame"]
9389 pub z_vel: f32,
9390 #[doc = "X position in local frame"]
9391 pub x_pos: f32,
9392 #[doc = "Y position in local frame"]
9393 pub y_pos: f32,
9394 #[doc = "Z position in local frame"]
9395 pub z_pos: f32,
9396 #[doc = "Airspeed, set to -1 if unknown"]
9397 pub airspeed: f32,
9398 #[doc = "Variance of body velocity estimate"]
9399 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9400 pub vel_variance: [f32; 3],
9401 #[doc = "Variance in local position"]
9402 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9403 pub pos_variance: [f32; 3],
9404 #[doc = "The attitude, represented as Quaternion"]
9405 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9406 pub q: [f32; 4],
9407 #[doc = "Angular rate in roll axis"]
9408 pub roll_rate: f32,
9409 #[doc = "Angular rate in pitch axis"]
9410 pub pitch_rate: f32,
9411 #[doc = "Angular rate in yaw axis"]
9412 pub yaw_rate: f32,
9413}
9414impl CONTROL_SYSTEM_STATE_DATA {
9415 pub const ENCODED_LEN: usize = 100usize;
9416 pub const DEFAULT: Self = Self {
9417 time_usec: 0_u64,
9418 x_acc: 0.0_f32,
9419 y_acc: 0.0_f32,
9420 z_acc: 0.0_f32,
9421 x_vel: 0.0_f32,
9422 y_vel: 0.0_f32,
9423 z_vel: 0.0_f32,
9424 x_pos: 0.0_f32,
9425 y_pos: 0.0_f32,
9426 z_pos: 0.0_f32,
9427 airspeed: 0.0_f32,
9428 vel_variance: [0.0_f32; 3usize],
9429 pos_variance: [0.0_f32; 3usize],
9430 q: [0.0_f32; 4usize],
9431 roll_rate: 0.0_f32,
9432 pitch_rate: 0.0_f32,
9433 yaw_rate: 0.0_f32,
9434 };
9435 #[cfg(feature = "arbitrary")]
9436 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9437 use arbitrary::{Arbitrary, Unstructured};
9438 let mut buf = [0u8; 1024];
9439 rng.fill_bytes(&mut buf);
9440 let mut unstructured = Unstructured::new(&buf);
9441 Self::arbitrary(&mut unstructured).unwrap_or_default()
9442 }
9443}
9444impl Default for CONTROL_SYSTEM_STATE_DATA {
9445 fn default() -> Self {
9446 Self::DEFAULT.clone()
9447 }
9448}
9449impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9450 type Message = MavMessage;
9451 const ID: u32 = 146u32;
9452 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9453 const EXTRA_CRC: u8 = 103u8;
9454 const ENCODED_LEN: usize = 100usize;
9455 fn deser(
9456 _version: MavlinkVersion,
9457 __input: &[u8],
9458 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9459 let avail_len = __input.len();
9460 let mut payload_buf = [0; Self::ENCODED_LEN];
9461 let mut buf = if avail_len < Self::ENCODED_LEN {
9462 payload_buf[0..avail_len].copy_from_slice(__input);
9463 Bytes::new(&payload_buf)
9464 } else {
9465 Bytes::new(__input)
9466 };
9467 let mut __struct = Self::default();
9468 __struct.time_usec = buf.get_u64_le();
9469 __struct.x_acc = buf.get_f32_le();
9470 __struct.y_acc = buf.get_f32_le();
9471 __struct.z_acc = buf.get_f32_le();
9472 __struct.x_vel = buf.get_f32_le();
9473 __struct.y_vel = buf.get_f32_le();
9474 __struct.z_vel = buf.get_f32_le();
9475 __struct.x_pos = buf.get_f32_le();
9476 __struct.y_pos = buf.get_f32_le();
9477 __struct.z_pos = buf.get_f32_le();
9478 __struct.airspeed = buf.get_f32_le();
9479 for v in &mut __struct.vel_variance {
9480 let val = buf.get_f32_le();
9481 *v = val;
9482 }
9483 for v in &mut __struct.pos_variance {
9484 let val = buf.get_f32_le();
9485 *v = val;
9486 }
9487 for v in &mut __struct.q {
9488 let val = buf.get_f32_le();
9489 *v = val;
9490 }
9491 __struct.roll_rate = buf.get_f32_le();
9492 __struct.pitch_rate = buf.get_f32_le();
9493 __struct.yaw_rate = buf.get_f32_le();
9494 Ok(__struct)
9495 }
9496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9497 let mut __tmp = BytesMut::new(bytes);
9498 #[allow(clippy::absurd_extreme_comparisons)]
9499 #[allow(unused_comparisons)]
9500 if __tmp.remaining() < Self::ENCODED_LEN {
9501 panic!(
9502 "buffer is too small (need {} bytes, but got {})",
9503 Self::ENCODED_LEN,
9504 __tmp.remaining(),
9505 )
9506 }
9507 __tmp.put_u64_le(self.time_usec);
9508 __tmp.put_f32_le(self.x_acc);
9509 __tmp.put_f32_le(self.y_acc);
9510 __tmp.put_f32_le(self.z_acc);
9511 __tmp.put_f32_le(self.x_vel);
9512 __tmp.put_f32_le(self.y_vel);
9513 __tmp.put_f32_le(self.z_vel);
9514 __tmp.put_f32_le(self.x_pos);
9515 __tmp.put_f32_le(self.y_pos);
9516 __tmp.put_f32_le(self.z_pos);
9517 __tmp.put_f32_le(self.airspeed);
9518 for val in &self.vel_variance {
9519 __tmp.put_f32_le(*val);
9520 }
9521 for val in &self.pos_variance {
9522 __tmp.put_f32_le(*val);
9523 }
9524 for val in &self.q {
9525 __tmp.put_f32_le(*val);
9526 }
9527 __tmp.put_f32_le(self.roll_rate);
9528 __tmp.put_f32_le(self.pitch_rate);
9529 __tmp.put_f32_le(self.yaw_rate);
9530 if matches!(version, MavlinkVersion::V2) {
9531 let len = __tmp.len();
9532 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9533 } else {
9534 __tmp.len()
9535 }
9536 }
9537}
9538#[doc = "offset response to encapsulated data."]
9539#[doc = ""]
9540#[doc = "ID: 50005"]
9541#[derive(Debug, Clone, PartialEq)]
9542#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9543#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9544pub struct CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9545 #[doc = "FW Offset."]
9546 pub offset: u32,
9547 #[doc = "System ID."]
9548 pub target_system: u8,
9549 #[doc = "Component ID."]
9550 pub target_component: u8,
9551}
9552impl CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9553 pub const ENCODED_LEN: usize = 6usize;
9554 pub const DEFAULT: Self = Self {
9555 offset: 0_u32,
9556 target_system: 0_u8,
9557 target_component: 0_u8,
9558 };
9559 #[cfg(feature = "arbitrary")]
9560 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9561 use arbitrary::{Arbitrary, Unstructured};
9562 let mut buf = [0u8; 1024];
9563 rng.fill_bytes(&mut buf);
9564 let mut unstructured = Unstructured::new(&buf);
9565 Self::arbitrary(&mut unstructured).unwrap_or_default()
9566 }
9567}
9568impl Default for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9569 fn default() -> Self {
9570 Self::DEFAULT.clone()
9571 }
9572}
9573impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9574 type Message = MavMessage;
9575 const ID: u32 = 50005u32;
9576 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_RESP";
9577 const EXTRA_CRC: u8 = 152u8;
9578 const ENCODED_LEN: usize = 6usize;
9579 fn deser(
9580 _version: MavlinkVersion,
9581 __input: &[u8],
9582 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9583 let avail_len = __input.len();
9584 let mut payload_buf = [0; Self::ENCODED_LEN];
9585 let mut buf = if avail_len < Self::ENCODED_LEN {
9586 payload_buf[0..avail_len].copy_from_slice(__input);
9587 Bytes::new(&payload_buf)
9588 } else {
9589 Bytes::new(__input)
9590 };
9591 let mut __struct = Self::default();
9592 __struct.offset = buf.get_u32_le();
9593 __struct.target_system = buf.get_u8();
9594 __struct.target_component = buf.get_u8();
9595 Ok(__struct)
9596 }
9597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9598 let mut __tmp = BytesMut::new(bytes);
9599 #[allow(clippy::absurd_extreme_comparisons)]
9600 #[allow(unused_comparisons)]
9601 if __tmp.remaining() < Self::ENCODED_LEN {
9602 panic!(
9603 "buffer is too small (need {} bytes, but got {})",
9604 Self::ENCODED_LEN,
9605 __tmp.remaining(),
9606 )
9607 }
9608 __tmp.put_u32_le(self.offset);
9609 __tmp.put_u8(self.target_system);
9610 __tmp.put_u8(self.target_component);
9611 if matches!(version, MavlinkVersion::V2) {
9612 let len = __tmp.len();
9613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9614 } else {
9615 __tmp.len()
9616 }
9617 }
9618}
9619#[doc = "Start firmware update with encapsulated data."]
9620#[doc = ""]
9621#[doc = "ID: 50004"]
9622#[derive(Debug, Clone, PartialEq)]
9623#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9625pub struct CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
9626 #[doc = "FW Size."]
9627 pub size: u32,
9628 #[doc = "FW CRC."]
9629 pub crc: u32,
9630 #[doc = "System ID."]
9631 pub target_system: u8,
9632 #[doc = "Component ID."]
9633 pub target_component: u8,
9634}
9635impl CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
9636 pub const ENCODED_LEN: usize = 10usize;
9637 pub const DEFAULT: Self = Self {
9638 size: 0_u32,
9639 crc: 0_u32,
9640 target_system: 0_u8,
9641 target_component: 0_u8,
9642 };
9643 #[cfg(feature = "arbitrary")]
9644 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9645 use arbitrary::{Arbitrary, Unstructured};
9646 let mut buf = [0u8; 1024];
9647 rng.fill_bytes(&mut buf);
9648 let mut unstructured = Unstructured::new(&buf);
9649 Self::arbitrary(&mut unstructured).unwrap_or_default()
9650 }
9651}
9652impl Default for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
9653 fn default() -> Self {
9654 Self::DEFAULT.clone()
9655 }
9656}
9657impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
9658 type Message = MavMessage;
9659 const ID: u32 = 50004u32;
9660 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_START";
9661 const EXTRA_CRC: u8 = 240u8;
9662 const ENCODED_LEN: usize = 10usize;
9663 fn deser(
9664 _version: MavlinkVersion,
9665 __input: &[u8],
9666 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9667 let avail_len = __input.len();
9668 let mut payload_buf = [0; Self::ENCODED_LEN];
9669 let mut buf = if avail_len < Self::ENCODED_LEN {
9670 payload_buf[0..avail_len].copy_from_slice(__input);
9671 Bytes::new(&payload_buf)
9672 } else {
9673 Bytes::new(__input)
9674 };
9675 let mut __struct = Self::default();
9676 __struct.size = buf.get_u32_le();
9677 __struct.crc = buf.get_u32_le();
9678 __struct.target_system = buf.get_u8();
9679 __struct.target_component = buf.get_u8();
9680 Ok(__struct)
9681 }
9682 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9683 let mut __tmp = BytesMut::new(bytes);
9684 #[allow(clippy::absurd_extreme_comparisons)]
9685 #[allow(unused_comparisons)]
9686 if __tmp.remaining() < Self::ENCODED_LEN {
9687 panic!(
9688 "buffer is too small (need {} bytes, but got {})",
9689 Self::ENCODED_LEN,
9690 __tmp.remaining(),
9691 )
9692 }
9693 __tmp.put_u32_le(self.size);
9694 __tmp.put_u32_le(self.crc);
9695 __tmp.put_u8(self.target_system);
9696 __tmp.put_u8(self.target_component);
9697 if matches!(version, MavlinkVersion::V2) {
9698 let len = __tmp.len();
9699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9700 } else {
9701 __tmp.len()
9702 }
9703 }
9704}
9705#[doc = "Raw RC Data."]
9706#[doc = ""]
9707#[doc = "ID: 50001"]
9708#[derive(Debug, Clone, PartialEq)]
9709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9711pub struct CUBEPILOT_RAW_RC_DATA {
9712 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9713 pub rc_raw: [u8; 32],
9714}
9715impl CUBEPILOT_RAW_RC_DATA {
9716 pub const ENCODED_LEN: usize = 32usize;
9717 pub const DEFAULT: Self = Self {
9718 rc_raw: [0_u8; 32usize],
9719 };
9720 #[cfg(feature = "arbitrary")]
9721 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9722 use arbitrary::{Arbitrary, Unstructured};
9723 let mut buf = [0u8; 1024];
9724 rng.fill_bytes(&mut buf);
9725 let mut unstructured = Unstructured::new(&buf);
9726 Self::arbitrary(&mut unstructured).unwrap_or_default()
9727 }
9728}
9729impl Default for CUBEPILOT_RAW_RC_DATA {
9730 fn default() -> Self {
9731 Self::DEFAULT.clone()
9732 }
9733}
9734impl MessageData for CUBEPILOT_RAW_RC_DATA {
9735 type Message = MavMessage;
9736 const ID: u32 = 50001u32;
9737 const NAME: &'static str = "CUBEPILOT_RAW_RC";
9738 const EXTRA_CRC: u8 = 246u8;
9739 const ENCODED_LEN: usize = 32usize;
9740 fn deser(
9741 _version: MavlinkVersion,
9742 __input: &[u8],
9743 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9744 let avail_len = __input.len();
9745 let mut payload_buf = [0; Self::ENCODED_LEN];
9746 let mut buf = if avail_len < Self::ENCODED_LEN {
9747 payload_buf[0..avail_len].copy_from_slice(__input);
9748 Bytes::new(&payload_buf)
9749 } else {
9750 Bytes::new(__input)
9751 };
9752 let mut __struct = Self::default();
9753 for v in &mut __struct.rc_raw {
9754 let val = buf.get_u8();
9755 *v = val;
9756 }
9757 Ok(__struct)
9758 }
9759 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9760 let mut __tmp = BytesMut::new(bytes);
9761 #[allow(clippy::absurd_extreme_comparisons)]
9762 #[allow(unused_comparisons)]
9763 if __tmp.remaining() < Self::ENCODED_LEN {
9764 panic!(
9765 "buffer is too small (need {} bytes, but got {})",
9766 Self::ENCODED_LEN,
9767 __tmp.remaining(),
9768 )
9769 }
9770 for val in &self.rc_raw {
9771 __tmp.put_u8(*val);
9772 }
9773 if matches!(version, MavlinkVersion::V2) {
9774 let len = __tmp.len();
9775 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9776 } else {
9777 __tmp.len()
9778 }
9779 }
9780}
9781#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9782#[doc = ""]
9783#[doc = "ID: 411"]
9784#[derive(Debug, Clone, PartialEq)]
9785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9787pub struct CURRENT_EVENT_SEQUENCE_DATA {
9788 #[doc = "Sequence number."]
9789 pub sequence: u16,
9790 #[doc = "Flag bitset."]
9791 pub flags: MavEventCurrentSequenceFlags,
9792}
9793impl CURRENT_EVENT_SEQUENCE_DATA {
9794 pub const ENCODED_LEN: usize = 3usize;
9795 pub const DEFAULT: Self = Self {
9796 sequence: 0_u16,
9797 flags: MavEventCurrentSequenceFlags::DEFAULT,
9798 };
9799 #[cfg(feature = "arbitrary")]
9800 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9801 use arbitrary::{Arbitrary, Unstructured};
9802 let mut buf = [0u8; 1024];
9803 rng.fill_bytes(&mut buf);
9804 let mut unstructured = Unstructured::new(&buf);
9805 Self::arbitrary(&mut unstructured).unwrap_or_default()
9806 }
9807}
9808impl Default for CURRENT_EVENT_SEQUENCE_DATA {
9809 fn default() -> Self {
9810 Self::DEFAULT.clone()
9811 }
9812}
9813impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
9814 type Message = MavMessage;
9815 const ID: u32 = 411u32;
9816 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
9817 const EXTRA_CRC: u8 = 106u8;
9818 const ENCODED_LEN: usize = 3usize;
9819 fn deser(
9820 _version: MavlinkVersion,
9821 __input: &[u8],
9822 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9823 let avail_len = __input.len();
9824 let mut payload_buf = [0; Self::ENCODED_LEN];
9825 let mut buf = if avail_len < Self::ENCODED_LEN {
9826 payload_buf[0..avail_len].copy_from_slice(__input);
9827 Bytes::new(&payload_buf)
9828 } else {
9829 Bytes::new(__input)
9830 };
9831 let mut __struct = Self::default();
9832 __struct.sequence = buf.get_u16_le();
9833 let tmp = buf.get_u8();
9834 __struct.flags =
9835 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9836 enum_type: "MavEventCurrentSequenceFlags",
9837 value: tmp as u32,
9838 })?;
9839 Ok(__struct)
9840 }
9841 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9842 let mut __tmp = BytesMut::new(bytes);
9843 #[allow(clippy::absurd_extreme_comparisons)]
9844 #[allow(unused_comparisons)]
9845 if __tmp.remaining() < Self::ENCODED_LEN {
9846 panic!(
9847 "buffer is too small (need {} bytes, but got {})",
9848 Self::ENCODED_LEN,
9849 __tmp.remaining(),
9850 )
9851 }
9852 __tmp.put_u16_le(self.sequence);
9853 __tmp.put_u8(self.flags as u8);
9854 if matches!(version, MavlinkVersion::V2) {
9855 let len = __tmp.len();
9856 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9857 } else {
9858 __tmp.len()
9859 }
9860 }
9861}
9862#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
9863#[doc = ""]
9864#[doc = "ID: 436"]
9865#[derive(Debug, Clone, PartialEq)]
9866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9868pub struct CURRENT_MODE_DATA {
9869 #[doc = "A bitfield for use for autopilot-specific flags"]
9870 pub custom_mode: u32,
9871 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
9872 pub intended_custom_mode: u32,
9873 #[doc = "Standard mode."]
9874 pub standard_mode: MavStandardMode,
9875}
9876impl CURRENT_MODE_DATA {
9877 pub const ENCODED_LEN: usize = 9usize;
9878 pub const DEFAULT: Self = Self {
9879 custom_mode: 0_u32,
9880 intended_custom_mode: 0_u32,
9881 standard_mode: MavStandardMode::DEFAULT,
9882 };
9883 #[cfg(feature = "arbitrary")]
9884 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9885 use arbitrary::{Arbitrary, Unstructured};
9886 let mut buf = [0u8; 1024];
9887 rng.fill_bytes(&mut buf);
9888 let mut unstructured = Unstructured::new(&buf);
9889 Self::arbitrary(&mut unstructured).unwrap_or_default()
9890 }
9891}
9892impl Default for CURRENT_MODE_DATA {
9893 fn default() -> Self {
9894 Self::DEFAULT.clone()
9895 }
9896}
9897impl MessageData for CURRENT_MODE_DATA {
9898 type Message = MavMessage;
9899 const ID: u32 = 436u32;
9900 const NAME: &'static str = "CURRENT_MODE";
9901 const EXTRA_CRC: u8 = 193u8;
9902 const ENCODED_LEN: usize = 9usize;
9903 fn deser(
9904 _version: MavlinkVersion,
9905 __input: &[u8],
9906 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9907 let avail_len = __input.len();
9908 let mut payload_buf = [0; Self::ENCODED_LEN];
9909 let mut buf = if avail_len < Self::ENCODED_LEN {
9910 payload_buf[0..avail_len].copy_from_slice(__input);
9911 Bytes::new(&payload_buf)
9912 } else {
9913 Bytes::new(__input)
9914 };
9915 let mut __struct = Self::default();
9916 __struct.custom_mode = buf.get_u32_le();
9917 __struct.intended_custom_mode = buf.get_u32_le();
9918 let tmp = buf.get_u8();
9919 __struct.standard_mode =
9920 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9921 enum_type: "MavStandardMode",
9922 value: tmp as u32,
9923 })?;
9924 Ok(__struct)
9925 }
9926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9927 let mut __tmp = BytesMut::new(bytes);
9928 #[allow(clippy::absurd_extreme_comparisons)]
9929 #[allow(unused_comparisons)]
9930 if __tmp.remaining() < Self::ENCODED_LEN {
9931 panic!(
9932 "buffer is too small (need {} bytes, but got {})",
9933 Self::ENCODED_LEN,
9934 __tmp.remaining(),
9935 )
9936 }
9937 __tmp.put_u32_le(self.custom_mode);
9938 __tmp.put_u32_le(self.intended_custom_mode);
9939 __tmp.put_u8(self.standard_mode as u8);
9940 if matches!(version, MavlinkVersion::V2) {
9941 let len = __tmp.len();
9942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9943 } else {
9944 __tmp.len()
9945 }
9946 }
9947}
9948#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
9949#[doc = "Data stream status information."]
9950#[doc = ""]
9951#[doc = "ID: 67"]
9952#[derive(Debug, Clone, PartialEq)]
9953#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9954#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9955pub struct DATA_STREAM_DATA {
9956 #[doc = "The message rate"]
9957 pub message_rate: u16,
9958 #[doc = "The ID of the requested data stream"]
9959 pub stream_id: u8,
9960 #[doc = "1 stream is enabled, 0 stream is stopped."]
9961 pub on_off: u8,
9962}
9963impl DATA_STREAM_DATA {
9964 pub const ENCODED_LEN: usize = 4usize;
9965 pub const DEFAULT: Self = Self {
9966 message_rate: 0_u16,
9967 stream_id: 0_u8,
9968 on_off: 0_u8,
9969 };
9970 #[cfg(feature = "arbitrary")]
9971 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9972 use arbitrary::{Arbitrary, Unstructured};
9973 let mut buf = [0u8; 1024];
9974 rng.fill_bytes(&mut buf);
9975 let mut unstructured = Unstructured::new(&buf);
9976 Self::arbitrary(&mut unstructured).unwrap_or_default()
9977 }
9978}
9979impl Default for DATA_STREAM_DATA {
9980 fn default() -> Self {
9981 Self::DEFAULT.clone()
9982 }
9983}
9984impl MessageData for DATA_STREAM_DATA {
9985 type Message = MavMessage;
9986 const ID: u32 = 67u32;
9987 const NAME: &'static str = "DATA_STREAM";
9988 const EXTRA_CRC: u8 = 21u8;
9989 const ENCODED_LEN: usize = 4usize;
9990 fn deser(
9991 _version: MavlinkVersion,
9992 __input: &[u8],
9993 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9994 let avail_len = __input.len();
9995 let mut payload_buf = [0; Self::ENCODED_LEN];
9996 let mut buf = if avail_len < Self::ENCODED_LEN {
9997 payload_buf[0..avail_len].copy_from_slice(__input);
9998 Bytes::new(&payload_buf)
9999 } else {
10000 Bytes::new(__input)
10001 };
10002 let mut __struct = Self::default();
10003 __struct.message_rate = buf.get_u16_le();
10004 __struct.stream_id = buf.get_u8();
10005 __struct.on_off = buf.get_u8();
10006 Ok(__struct)
10007 }
10008 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10009 let mut __tmp = BytesMut::new(bytes);
10010 #[allow(clippy::absurd_extreme_comparisons)]
10011 #[allow(unused_comparisons)]
10012 if __tmp.remaining() < Self::ENCODED_LEN {
10013 panic!(
10014 "buffer is too small (need {} bytes, but got {})",
10015 Self::ENCODED_LEN,
10016 __tmp.remaining(),
10017 )
10018 }
10019 __tmp.put_u16_le(self.message_rate);
10020 __tmp.put_u8(self.stream_id);
10021 __tmp.put_u8(self.on_off);
10022 if matches!(version, MavlinkVersion::V2) {
10023 let len = __tmp.len();
10024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10025 } else {
10026 __tmp.len()
10027 }
10028 }
10029}
10030#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10031#[doc = ""]
10032#[doc = "ID: 130"]
10033#[derive(Debug, Clone, PartialEq)]
10034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10036pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10037 #[doc = "total data size (set on ACK only)."]
10038 pub size: u32,
10039 #[doc = "Width of a matrix or image."]
10040 pub width: u16,
10041 #[doc = "Height of a matrix or image."]
10042 pub height: u16,
10043 #[doc = "Number of packets being sent (set on ACK only)."]
10044 pub packets: u16,
10045 #[doc = "Type of requested/acknowledged data."]
10046 pub mavtype: MavlinkDataStreamType,
10047 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10048 pub payload: u8,
10049 #[doc = "JPEG quality. Values: [1-100]."]
10050 pub jpg_quality: u8,
10051}
10052impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10053 pub const ENCODED_LEN: usize = 13usize;
10054 pub const DEFAULT: Self = Self {
10055 size: 0_u32,
10056 width: 0_u16,
10057 height: 0_u16,
10058 packets: 0_u16,
10059 mavtype: MavlinkDataStreamType::DEFAULT,
10060 payload: 0_u8,
10061 jpg_quality: 0_u8,
10062 };
10063 #[cfg(feature = "arbitrary")]
10064 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10065 use arbitrary::{Arbitrary, Unstructured};
10066 let mut buf = [0u8; 1024];
10067 rng.fill_bytes(&mut buf);
10068 let mut unstructured = Unstructured::new(&buf);
10069 Self::arbitrary(&mut unstructured).unwrap_or_default()
10070 }
10071}
10072impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10073 fn default() -> Self {
10074 Self::DEFAULT.clone()
10075 }
10076}
10077impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10078 type Message = MavMessage;
10079 const ID: u32 = 130u32;
10080 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10081 const EXTRA_CRC: u8 = 29u8;
10082 const ENCODED_LEN: usize = 13usize;
10083 fn deser(
10084 _version: MavlinkVersion,
10085 __input: &[u8],
10086 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10087 let avail_len = __input.len();
10088 let mut payload_buf = [0; Self::ENCODED_LEN];
10089 let mut buf = if avail_len < Self::ENCODED_LEN {
10090 payload_buf[0..avail_len].copy_from_slice(__input);
10091 Bytes::new(&payload_buf)
10092 } else {
10093 Bytes::new(__input)
10094 };
10095 let mut __struct = Self::default();
10096 __struct.size = buf.get_u32_le();
10097 __struct.width = buf.get_u16_le();
10098 __struct.height = buf.get_u16_le();
10099 __struct.packets = buf.get_u16_le();
10100 let tmp = buf.get_u8();
10101 __struct.mavtype =
10102 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10103 enum_type: "MavlinkDataStreamType",
10104 value: tmp as u32,
10105 })?;
10106 __struct.payload = buf.get_u8();
10107 __struct.jpg_quality = buf.get_u8();
10108 Ok(__struct)
10109 }
10110 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10111 let mut __tmp = BytesMut::new(bytes);
10112 #[allow(clippy::absurd_extreme_comparisons)]
10113 #[allow(unused_comparisons)]
10114 if __tmp.remaining() < Self::ENCODED_LEN {
10115 panic!(
10116 "buffer is too small (need {} bytes, but got {})",
10117 Self::ENCODED_LEN,
10118 __tmp.remaining(),
10119 )
10120 }
10121 __tmp.put_u32_le(self.size);
10122 __tmp.put_u16_le(self.width);
10123 __tmp.put_u16_le(self.height);
10124 __tmp.put_u16_le(self.packets);
10125 __tmp.put_u8(self.mavtype as u8);
10126 __tmp.put_u8(self.payload);
10127 __tmp.put_u8(self.jpg_quality);
10128 if matches!(version, MavlinkVersion::V2) {
10129 let len = __tmp.len();
10130 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10131 } else {
10132 __tmp.len()
10133 }
10134 }
10135}
10136#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10137#[doc = ""]
10138#[doc = "ID: 254"]
10139#[derive(Debug, Clone, PartialEq)]
10140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10141#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10142pub struct DEBUG_DATA {
10143 #[doc = "Timestamp (time since system boot)."]
10144 pub time_boot_ms: u32,
10145 #[doc = "DEBUG value"]
10146 pub value: f32,
10147 #[doc = "index of debug variable"]
10148 pub ind: u8,
10149}
10150impl DEBUG_DATA {
10151 pub const ENCODED_LEN: usize = 9usize;
10152 pub const DEFAULT: Self = Self {
10153 time_boot_ms: 0_u32,
10154 value: 0.0_f32,
10155 ind: 0_u8,
10156 };
10157 #[cfg(feature = "arbitrary")]
10158 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10159 use arbitrary::{Arbitrary, Unstructured};
10160 let mut buf = [0u8; 1024];
10161 rng.fill_bytes(&mut buf);
10162 let mut unstructured = Unstructured::new(&buf);
10163 Self::arbitrary(&mut unstructured).unwrap_or_default()
10164 }
10165}
10166impl Default for DEBUG_DATA {
10167 fn default() -> Self {
10168 Self::DEFAULT.clone()
10169 }
10170}
10171impl MessageData for DEBUG_DATA {
10172 type Message = MavMessage;
10173 const ID: u32 = 254u32;
10174 const NAME: &'static str = "DEBUG";
10175 const EXTRA_CRC: u8 = 46u8;
10176 const ENCODED_LEN: usize = 9usize;
10177 fn deser(
10178 _version: MavlinkVersion,
10179 __input: &[u8],
10180 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10181 let avail_len = __input.len();
10182 let mut payload_buf = [0; Self::ENCODED_LEN];
10183 let mut buf = if avail_len < Self::ENCODED_LEN {
10184 payload_buf[0..avail_len].copy_from_slice(__input);
10185 Bytes::new(&payload_buf)
10186 } else {
10187 Bytes::new(__input)
10188 };
10189 let mut __struct = Self::default();
10190 __struct.time_boot_ms = buf.get_u32_le();
10191 __struct.value = buf.get_f32_le();
10192 __struct.ind = buf.get_u8();
10193 Ok(__struct)
10194 }
10195 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10196 let mut __tmp = BytesMut::new(bytes);
10197 #[allow(clippy::absurd_extreme_comparisons)]
10198 #[allow(unused_comparisons)]
10199 if __tmp.remaining() < Self::ENCODED_LEN {
10200 panic!(
10201 "buffer is too small (need {} bytes, but got {})",
10202 Self::ENCODED_LEN,
10203 __tmp.remaining(),
10204 )
10205 }
10206 __tmp.put_u32_le(self.time_boot_ms);
10207 __tmp.put_f32_le(self.value);
10208 __tmp.put_u8(self.ind);
10209 if matches!(version, MavlinkVersion::V2) {
10210 let len = __tmp.len();
10211 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10212 } else {
10213 __tmp.len()
10214 }
10215 }
10216}
10217#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10218#[doc = ""]
10219#[doc = "ID: 350"]
10220#[derive(Debug, Clone, PartialEq)]
10221#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10223pub struct DEBUG_FLOAT_ARRAY_DATA {
10224 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10225 pub time_usec: u64,
10226 #[doc = "Unique ID used to discriminate between arrays"]
10227 pub array_id: u16,
10228 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10229 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10230 pub name: [u8; 10],
10231 #[doc = "data"]
10232 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10233 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10234 pub data: [f32; 58],
10235}
10236impl DEBUG_FLOAT_ARRAY_DATA {
10237 pub const ENCODED_LEN: usize = 252usize;
10238 pub const DEFAULT: Self = Self {
10239 time_usec: 0_u64,
10240 array_id: 0_u16,
10241 name: [0_u8; 10usize],
10242 data: [0.0_f32; 58usize],
10243 };
10244 #[cfg(feature = "arbitrary")]
10245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10246 use arbitrary::{Arbitrary, Unstructured};
10247 let mut buf = [0u8; 1024];
10248 rng.fill_bytes(&mut buf);
10249 let mut unstructured = Unstructured::new(&buf);
10250 Self::arbitrary(&mut unstructured).unwrap_or_default()
10251 }
10252}
10253impl Default for DEBUG_FLOAT_ARRAY_DATA {
10254 fn default() -> Self {
10255 Self::DEFAULT.clone()
10256 }
10257}
10258impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10259 type Message = MavMessage;
10260 const ID: u32 = 350u32;
10261 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10262 const EXTRA_CRC: u8 = 232u8;
10263 const ENCODED_LEN: usize = 252usize;
10264 fn deser(
10265 _version: MavlinkVersion,
10266 __input: &[u8],
10267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10268 let avail_len = __input.len();
10269 let mut payload_buf = [0; Self::ENCODED_LEN];
10270 let mut buf = if avail_len < Self::ENCODED_LEN {
10271 payload_buf[0..avail_len].copy_from_slice(__input);
10272 Bytes::new(&payload_buf)
10273 } else {
10274 Bytes::new(__input)
10275 };
10276 let mut __struct = Self::default();
10277 __struct.time_usec = buf.get_u64_le();
10278 __struct.array_id = buf.get_u16_le();
10279 for v in &mut __struct.name {
10280 let val = buf.get_u8();
10281 *v = val;
10282 }
10283 for v in &mut __struct.data {
10284 let val = buf.get_f32_le();
10285 *v = val;
10286 }
10287 Ok(__struct)
10288 }
10289 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10290 let mut __tmp = BytesMut::new(bytes);
10291 #[allow(clippy::absurd_extreme_comparisons)]
10292 #[allow(unused_comparisons)]
10293 if __tmp.remaining() < Self::ENCODED_LEN {
10294 panic!(
10295 "buffer is too small (need {} bytes, but got {})",
10296 Self::ENCODED_LEN,
10297 __tmp.remaining(),
10298 )
10299 }
10300 __tmp.put_u64_le(self.time_usec);
10301 __tmp.put_u16_le(self.array_id);
10302 for val in &self.name {
10303 __tmp.put_u8(*val);
10304 }
10305 if matches!(version, MavlinkVersion::V2) {
10306 for val in &self.data {
10307 __tmp.put_f32_le(*val);
10308 }
10309 let len = __tmp.len();
10310 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10311 } else {
10312 __tmp.len()
10313 }
10314 }
10315}
10316#[doc = "To debug something using a named 3D vector."]
10317#[doc = ""]
10318#[doc = "ID: 250"]
10319#[derive(Debug, Clone, PartialEq)]
10320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10322pub struct DEBUG_VECT_DATA {
10323 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10324 pub time_usec: u64,
10325 #[doc = "x"]
10326 pub x: f32,
10327 #[doc = "y"]
10328 pub y: f32,
10329 #[doc = "z"]
10330 pub z: f32,
10331 #[doc = "Name"]
10332 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10333 pub name: [u8; 10],
10334}
10335impl DEBUG_VECT_DATA {
10336 pub const ENCODED_LEN: usize = 30usize;
10337 pub const DEFAULT: Self = Self {
10338 time_usec: 0_u64,
10339 x: 0.0_f32,
10340 y: 0.0_f32,
10341 z: 0.0_f32,
10342 name: [0_u8; 10usize],
10343 };
10344 #[cfg(feature = "arbitrary")]
10345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10346 use arbitrary::{Arbitrary, Unstructured};
10347 let mut buf = [0u8; 1024];
10348 rng.fill_bytes(&mut buf);
10349 let mut unstructured = Unstructured::new(&buf);
10350 Self::arbitrary(&mut unstructured).unwrap_or_default()
10351 }
10352}
10353impl Default for DEBUG_VECT_DATA {
10354 fn default() -> Self {
10355 Self::DEFAULT.clone()
10356 }
10357}
10358impl MessageData for DEBUG_VECT_DATA {
10359 type Message = MavMessage;
10360 const ID: u32 = 250u32;
10361 const NAME: &'static str = "DEBUG_VECT";
10362 const EXTRA_CRC: u8 = 49u8;
10363 const ENCODED_LEN: usize = 30usize;
10364 fn deser(
10365 _version: MavlinkVersion,
10366 __input: &[u8],
10367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10368 let avail_len = __input.len();
10369 let mut payload_buf = [0; Self::ENCODED_LEN];
10370 let mut buf = if avail_len < Self::ENCODED_LEN {
10371 payload_buf[0..avail_len].copy_from_slice(__input);
10372 Bytes::new(&payload_buf)
10373 } else {
10374 Bytes::new(__input)
10375 };
10376 let mut __struct = Self::default();
10377 __struct.time_usec = buf.get_u64_le();
10378 __struct.x = buf.get_f32_le();
10379 __struct.y = buf.get_f32_le();
10380 __struct.z = buf.get_f32_le();
10381 for v in &mut __struct.name {
10382 let val = buf.get_u8();
10383 *v = val;
10384 }
10385 Ok(__struct)
10386 }
10387 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10388 let mut __tmp = BytesMut::new(bytes);
10389 #[allow(clippy::absurd_extreme_comparisons)]
10390 #[allow(unused_comparisons)]
10391 if __tmp.remaining() < Self::ENCODED_LEN {
10392 panic!(
10393 "buffer is too small (need {} bytes, but got {})",
10394 Self::ENCODED_LEN,
10395 __tmp.remaining(),
10396 )
10397 }
10398 __tmp.put_u64_le(self.time_usec);
10399 __tmp.put_f32_le(self.x);
10400 __tmp.put_f32_le(self.y);
10401 __tmp.put_f32_le(self.z);
10402 for val in &self.name {
10403 __tmp.put_u8(*val);
10404 }
10405 if matches!(version, MavlinkVersion::V2) {
10406 let len = __tmp.len();
10407 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10408 } else {
10409 __tmp.len()
10410 }
10411 }
10412}
10413#[doc = "Distance sensor information for an onboard rangefinder."]
10414#[doc = ""]
10415#[doc = "ID: 132"]
10416#[derive(Debug, Clone, PartialEq)]
10417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10418#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10419pub struct DISTANCE_SENSOR_DATA {
10420 #[doc = "Timestamp (time since system boot)."]
10421 pub time_boot_ms: u32,
10422 #[doc = "Minimum distance the sensor can measure"]
10423 pub min_distance: u16,
10424 #[doc = "Maximum distance the sensor can measure"]
10425 pub max_distance: u16,
10426 #[doc = "Current distance reading"]
10427 pub current_distance: u16,
10428 #[doc = "Type of distance sensor."]
10429 pub mavtype: MavDistanceSensor,
10430 #[doc = "Onboard ID of the sensor"]
10431 pub id: u8,
10432 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10433 pub orientation: MavSensorOrientation,
10434 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10435 pub covariance: u8,
10436 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10437 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10438 pub horizontal_fov: f32,
10439 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10440 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10441 pub vertical_fov: f32,
10442 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10443 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10445 pub quaternion: [f32; 4],
10446 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10447 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10448 pub signal_quality: u8,
10449}
10450impl DISTANCE_SENSOR_DATA {
10451 pub const ENCODED_LEN: usize = 39usize;
10452 pub const DEFAULT: Self = Self {
10453 time_boot_ms: 0_u32,
10454 min_distance: 0_u16,
10455 max_distance: 0_u16,
10456 current_distance: 0_u16,
10457 mavtype: MavDistanceSensor::DEFAULT,
10458 id: 0_u8,
10459 orientation: MavSensorOrientation::DEFAULT,
10460 covariance: 0_u8,
10461 horizontal_fov: 0.0_f32,
10462 vertical_fov: 0.0_f32,
10463 quaternion: [0.0_f32; 4usize],
10464 signal_quality: 0_u8,
10465 };
10466 #[cfg(feature = "arbitrary")]
10467 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10468 use arbitrary::{Arbitrary, Unstructured};
10469 let mut buf = [0u8; 1024];
10470 rng.fill_bytes(&mut buf);
10471 let mut unstructured = Unstructured::new(&buf);
10472 Self::arbitrary(&mut unstructured).unwrap_or_default()
10473 }
10474}
10475impl Default for DISTANCE_SENSOR_DATA {
10476 fn default() -> Self {
10477 Self::DEFAULT.clone()
10478 }
10479}
10480impl MessageData for DISTANCE_SENSOR_DATA {
10481 type Message = MavMessage;
10482 const ID: u32 = 132u32;
10483 const NAME: &'static str = "DISTANCE_SENSOR";
10484 const EXTRA_CRC: u8 = 85u8;
10485 const ENCODED_LEN: usize = 39usize;
10486 fn deser(
10487 _version: MavlinkVersion,
10488 __input: &[u8],
10489 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10490 let avail_len = __input.len();
10491 let mut payload_buf = [0; Self::ENCODED_LEN];
10492 let mut buf = if avail_len < Self::ENCODED_LEN {
10493 payload_buf[0..avail_len].copy_from_slice(__input);
10494 Bytes::new(&payload_buf)
10495 } else {
10496 Bytes::new(__input)
10497 };
10498 let mut __struct = Self::default();
10499 __struct.time_boot_ms = buf.get_u32_le();
10500 __struct.min_distance = buf.get_u16_le();
10501 __struct.max_distance = buf.get_u16_le();
10502 __struct.current_distance = buf.get_u16_le();
10503 let tmp = buf.get_u8();
10504 __struct.mavtype =
10505 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10506 enum_type: "MavDistanceSensor",
10507 value: tmp as u32,
10508 })?;
10509 __struct.id = buf.get_u8();
10510 let tmp = buf.get_u8();
10511 __struct.orientation =
10512 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10513 enum_type: "MavSensorOrientation",
10514 value: tmp as u32,
10515 })?;
10516 __struct.covariance = buf.get_u8();
10517 __struct.horizontal_fov = buf.get_f32_le();
10518 __struct.vertical_fov = buf.get_f32_le();
10519 for v in &mut __struct.quaternion {
10520 let val = buf.get_f32_le();
10521 *v = val;
10522 }
10523 __struct.signal_quality = buf.get_u8();
10524 Ok(__struct)
10525 }
10526 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10527 let mut __tmp = BytesMut::new(bytes);
10528 #[allow(clippy::absurd_extreme_comparisons)]
10529 #[allow(unused_comparisons)]
10530 if __tmp.remaining() < Self::ENCODED_LEN {
10531 panic!(
10532 "buffer is too small (need {} bytes, but got {})",
10533 Self::ENCODED_LEN,
10534 __tmp.remaining(),
10535 )
10536 }
10537 __tmp.put_u32_le(self.time_boot_ms);
10538 __tmp.put_u16_le(self.min_distance);
10539 __tmp.put_u16_le(self.max_distance);
10540 __tmp.put_u16_le(self.current_distance);
10541 __tmp.put_u8(self.mavtype as u8);
10542 __tmp.put_u8(self.id);
10543 __tmp.put_u8(self.orientation as u8);
10544 __tmp.put_u8(self.covariance);
10545 if matches!(version, MavlinkVersion::V2) {
10546 __tmp.put_f32_le(self.horizontal_fov);
10547 __tmp.put_f32_le(self.vertical_fov);
10548 for val in &self.quaternion {
10549 __tmp.put_f32_le(*val);
10550 }
10551 __tmp.put_u8(self.signal_quality);
10552 let len = __tmp.len();
10553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10554 } else {
10555 __tmp.len()
10556 }
10557 }
10558}
10559#[doc = "EFI status output."]
10560#[doc = ""]
10561#[doc = "ID: 225"]
10562#[derive(Debug, Clone, PartialEq)]
10563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10565pub struct EFI_STATUS_DATA {
10566 #[doc = "ECU index"]
10567 pub ecu_index: f32,
10568 #[doc = "RPM"]
10569 pub rpm: f32,
10570 #[doc = "Fuel consumed"]
10571 pub fuel_consumed: f32,
10572 #[doc = "Fuel flow rate"]
10573 pub fuel_flow: f32,
10574 #[doc = "Engine load"]
10575 pub engine_load: f32,
10576 #[doc = "Throttle position"]
10577 pub throttle_position: f32,
10578 #[doc = "Spark dwell time"]
10579 pub spark_dwell_time: f32,
10580 #[doc = "Barometric pressure"]
10581 pub barometric_pressure: f32,
10582 #[doc = "Intake manifold pressure("]
10583 pub intake_manifold_pressure: f32,
10584 #[doc = "Intake manifold temperature"]
10585 pub intake_manifold_temperature: f32,
10586 #[doc = "Cylinder head temperature"]
10587 pub cylinder_head_temperature: f32,
10588 #[doc = "Ignition timing (Crank angle degrees)"]
10589 pub ignition_timing: f32,
10590 #[doc = "Injection time"]
10591 pub injection_time: f32,
10592 #[doc = "Exhaust gas temperature"]
10593 pub exhaust_gas_temperature: f32,
10594 #[doc = "Output throttle"]
10595 pub throttle_out: f32,
10596 #[doc = "Pressure/temperature compensation"]
10597 pub pt_compensation: f32,
10598 #[doc = "EFI health status"]
10599 pub health: u8,
10600 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10601 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10602 pub ignition_voltage: f32,
10603 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10604 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10605 pub fuel_pressure: f32,
10606}
10607impl EFI_STATUS_DATA {
10608 pub const ENCODED_LEN: usize = 73usize;
10609 pub const DEFAULT: Self = Self {
10610 ecu_index: 0.0_f32,
10611 rpm: 0.0_f32,
10612 fuel_consumed: 0.0_f32,
10613 fuel_flow: 0.0_f32,
10614 engine_load: 0.0_f32,
10615 throttle_position: 0.0_f32,
10616 spark_dwell_time: 0.0_f32,
10617 barometric_pressure: 0.0_f32,
10618 intake_manifold_pressure: 0.0_f32,
10619 intake_manifold_temperature: 0.0_f32,
10620 cylinder_head_temperature: 0.0_f32,
10621 ignition_timing: 0.0_f32,
10622 injection_time: 0.0_f32,
10623 exhaust_gas_temperature: 0.0_f32,
10624 throttle_out: 0.0_f32,
10625 pt_compensation: 0.0_f32,
10626 health: 0_u8,
10627 ignition_voltage: 0.0_f32,
10628 fuel_pressure: 0.0_f32,
10629 };
10630 #[cfg(feature = "arbitrary")]
10631 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10632 use arbitrary::{Arbitrary, Unstructured};
10633 let mut buf = [0u8; 1024];
10634 rng.fill_bytes(&mut buf);
10635 let mut unstructured = Unstructured::new(&buf);
10636 Self::arbitrary(&mut unstructured).unwrap_or_default()
10637 }
10638}
10639impl Default for EFI_STATUS_DATA {
10640 fn default() -> Self {
10641 Self::DEFAULT.clone()
10642 }
10643}
10644impl MessageData for EFI_STATUS_DATA {
10645 type Message = MavMessage;
10646 const ID: u32 = 225u32;
10647 const NAME: &'static str = "EFI_STATUS";
10648 const EXTRA_CRC: u8 = 208u8;
10649 const ENCODED_LEN: usize = 73usize;
10650 fn deser(
10651 _version: MavlinkVersion,
10652 __input: &[u8],
10653 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10654 let avail_len = __input.len();
10655 let mut payload_buf = [0; Self::ENCODED_LEN];
10656 let mut buf = if avail_len < Self::ENCODED_LEN {
10657 payload_buf[0..avail_len].copy_from_slice(__input);
10658 Bytes::new(&payload_buf)
10659 } else {
10660 Bytes::new(__input)
10661 };
10662 let mut __struct = Self::default();
10663 __struct.ecu_index = buf.get_f32_le();
10664 __struct.rpm = buf.get_f32_le();
10665 __struct.fuel_consumed = buf.get_f32_le();
10666 __struct.fuel_flow = buf.get_f32_le();
10667 __struct.engine_load = buf.get_f32_le();
10668 __struct.throttle_position = buf.get_f32_le();
10669 __struct.spark_dwell_time = buf.get_f32_le();
10670 __struct.barometric_pressure = buf.get_f32_le();
10671 __struct.intake_manifold_pressure = buf.get_f32_le();
10672 __struct.intake_manifold_temperature = buf.get_f32_le();
10673 __struct.cylinder_head_temperature = buf.get_f32_le();
10674 __struct.ignition_timing = buf.get_f32_le();
10675 __struct.injection_time = buf.get_f32_le();
10676 __struct.exhaust_gas_temperature = buf.get_f32_le();
10677 __struct.throttle_out = buf.get_f32_le();
10678 __struct.pt_compensation = buf.get_f32_le();
10679 __struct.health = buf.get_u8();
10680 __struct.ignition_voltage = buf.get_f32_le();
10681 __struct.fuel_pressure = buf.get_f32_le();
10682 Ok(__struct)
10683 }
10684 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10685 let mut __tmp = BytesMut::new(bytes);
10686 #[allow(clippy::absurd_extreme_comparisons)]
10687 #[allow(unused_comparisons)]
10688 if __tmp.remaining() < Self::ENCODED_LEN {
10689 panic!(
10690 "buffer is too small (need {} bytes, but got {})",
10691 Self::ENCODED_LEN,
10692 __tmp.remaining(),
10693 )
10694 }
10695 __tmp.put_f32_le(self.ecu_index);
10696 __tmp.put_f32_le(self.rpm);
10697 __tmp.put_f32_le(self.fuel_consumed);
10698 __tmp.put_f32_le(self.fuel_flow);
10699 __tmp.put_f32_le(self.engine_load);
10700 __tmp.put_f32_le(self.throttle_position);
10701 __tmp.put_f32_le(self.spark_dwell_time);
10702 __tmp.put_f32_le(self.barometric_pressure);
10703 __tmp.put_f32_le(self.intake_manifold_pressure);
10704 __tmp.put_f32_le(self.intake_manifold_temperature);
10705 __tmp.put_f32_le(self.cylinder_head_temperature);
10706 __tmp.put_f32_le(self.ignition_timing);
10707 __tmp.put_f32_le(self.injection_time);
10708 __tmp.put_f32_le(self.exhaust_gas_temperature);
10709 __tmp.put_f32_le(self.throttle_out);
10710 __tmp.put_f32_le(self.pt_compensation);
10711 __tmp.put_u8(self.health);
10712 if matches!(version, MavlinkVersion::V2) {
10713 __tmp.put_f32_le(self.ignition_voltage);
10714 __tmp.put_f32_le(self.fuel_pressure);
10715 let len = __tmp.len();
10716 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10717 } else {
10718 __tmp.len()
10719 }
10720 }
10721}
10722#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10723#[doc = ""]
10724#[doc = "ID: 131"]
10725#[derive(Debug, Clone, PartialEq)]
10726#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10728pub struct ENCAPSULATED_DATA_DATA {
10729 #[doc = "sequence number (starting with 0 on every transmission)"]
10730 pub seqnr: u16,
10731 #[doc = "image data bytes"]
10732 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10733 pub data: [u8; 253],
10734}
10735impl ENCAPSULATED_DATA_DATA {
10736 pub const ENCODED_LEN: usize = 255usize;
10737 pub const DEFAULT: Self = Self {
10738 seqnr: 0_u16,
10739 data: [0_u8; 253usize],
10740 };
10741 #[cfg(feature = "arbitrary")]
10742 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10743 use arbitrary::{Arbitrary, Unstructured};
10744 let mut buf = [0u8; 1024];
10745 rng.fill_bytes(&mut buf);
10746 let mut unstructured = Unstructured::new(&buf);
10747 Self::arbitrary(&mut unstructured).unwrap_or_default()
10748 }
10749}
10750impl Default for ENCAPSULATED_DATA_DATA {
10751 fn default() -> Self {
10752 Self::DEFAULT.clone()
10753 }
10754}
10755impl MessageData for ENCAPSULATED_DATA_DATA {
10756 type Message = MavMessage;
10757 const ID: u32 = 131u32;
10758 const NAME: &'static str = "ENCAPSULATED_DATA";
10759 const EXTRA_CRC: u8 = 223u8;
10760 const ENCODED_LEN: usize = 255usize;
10761 fn deser(
10762 _version: MavlinkVersion,
10763 __input: &[u8],
10764 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10765 let avail_len = __input.len();
10766 let mut payload_buf = [0; Self::ENCODED_LEN];
10767 let mut buf = if avail_len < Self::ENCODED_LEN {
10768 payload_buf[0..avail_len].copy_from_slice(__input);
10769 Bytes::new(&payload_buf)
10770 } else {
10771 Bytes::new(__input)
10772 };
10773 let mut __struct = Self::default();
10774 __struct.seqnr = buf.get_u16_le();
10775 for v in &mut __struct.data {
10776 let val = buf.get_u8();
10777 *v = val;
10778 }
10779 Ok(__struct)
10780 }
10781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10782 let mut __tmp = BytesMut::new(bytes);
10783 #[allow(clippy::absurd_extreme_comparisons)]
10784 #[allow(unused_comparisons)]
10785 if __tmp.remaining() < Self::ENCODED_LEN {
10786 panic!(
10787 "buffer is too small (need {} bytes, but got {})",
10788 Self::ENCODED_LEN,
10789 __tmp.remaining(),
10790 )
10791 }
10792 __tmp.put_u16_le(self.seqnr);
10793 for val in &self.data {
10794 __tmp.put_u8(*val);
10795 }
10796 if matches!(version, MavlinkVersion::V2) {
10797 let len = __tmp.len();
10798 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10799 } else {
10800 __tmp.len()
10801 }
10802 }
10803}
10804#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10805#[doc = ""]
10806#[doc = "ID: 290"]
10807#[derive(Debug, Clone, PartialEq)]
10808#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10809#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10810pub struct ESC_INFO_DATA {
10811 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10812 pub time_usec: u64,
10813 #[doc = "Number of reported errors by each ESC since boot."]
10814 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10815 pub error_count: [u32; 4],
10816 #[doc = "Counter of data packets received."]
10817 pub counter: u16,
10818 #[doc = "Bitmap of ESC failure flags."]
10819 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10820 pub failure_flags: [u16; 4],
10821 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
10822 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10823 pub temperature: [i16; 4],
10824 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10825 pub index: u8,
10826 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
10827 pub count: u8,
10828 #[doc = "Connection type protocol for all ESC."]
10829 pub connection_type: EscConnectionType,
10830 #[doc = "Information regarding online/offline status of each ESC."]
10831 pub info: u8,
10832}
10833impl ESC_INFO_DATA {
10834 pub const ENCODED_LEN: usize = 46usize;
10835 pub const DEFAULT: Self = Self {
10836 time_usec: 0_u64,
10837 error_count: [0_u32; 4usize],
10838 counter: 0_u16,
10839 failure_flags: [0_u16; 4usize],
10840 temperature: [0_i16; 4usize],
10841 index: 0_u8,
10842 count: 0_u8,
10843 connection_type: EscConnectionType::DEFAULT,
10844 info: 0_u8,
10845 };
10846 #[cfg(feature = "arbitrary")]
10847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10848 use arbitrary::{Arbitrary, Unstructured};
10849 let mut buf = [0u8; 1024];
10850 rng.fill_bytes(&mut buf);
10851 let mut unstructured = Unstructured::new(&buf);
10852 Self::arbitrary(&mut unstructured).unwrap_or_default()
10853 }
10854}
10855impl Default for ESC_INFO_DATA {
10856 fn default() -> Self {
10857 Self::DEFAULT.clone()
10858 }
10859}
10860impl MessageData for ESC_INFO_DATA {
10861 type Message = MavMessage;
10862 const ID: u32 = 290u32;
10863 const NAME: &'static str = "ESC_INFO";
10864 const EXTRA_CRC: u8 = 251u8;
10865 const ENCODED_LEN: usize = 46usize;
10866 fn deser(
10867 _version: MavlinkVersion,
10868 __input: &[u8],
10869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10870 let avail_len = __input.len();
10871 let mut payload_buf = [0; Self::ENCODED_LEN];
10872 let mut buf = if avail_len < Self::ENCODED_LEN {
10873 payload_buf[0..avail_len].copy_from_slice(__input);
10874 Bytes::new(&payload_buf)
10875 } else {
10876 Bytes::new(__input)
10877 };
10878 let mut __struct = Self::default();
10879 __struct.time_usec = buf.get_u64_le();
10880 for v in &mut __struct.error_count {
10881 let val = buf.get_u32_le();
10882 *v = val;
10883 }
10884 __struct.counter = buf.get_u16_le();
10885 for v in &mut __struct.failure_flags {
10886 let val = buf.get_u16_le();
10887 *v = val;
10888 }
10889 for v in &mut __struct.temperature {
10890 let val = buf.get_i16_le();
10891 *v = val;
10892 }
10893 __struct.index = buf.get_u8();
10894 __struct.count = buf.get_u8();
10895 let tmp = buf.get_u8();
10896 __struct.connection_type =
10897 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10898 enum_type: "EscConnectionType",
10899 value: tmp as u32,
10900 })?;
10901 __struct.info = buf.get_u8();
10902 Ok(__struct)
10903 }
10904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10905 let mut __tmp = BytesMut::new(bytes);
10906 #[allow(clippy::absurd_extreme_comparisons)]
10907 #[allow(unused_comparisons)]
10908 if __tmp.remaining() < Self::ENCODED_LEN {
10909 panic!(
10910 "buffer is too small (need {} bytes, but got {})",
10911 Self::ENCODED_LEN,
10912 __tmp.remaining(),
10913 )
10914 }
10915 __tmp.put_u64_le(self.time_usec);
10916 for val in &self.error_count {
10917 __tmp.put_u32_le(*val);
10918 }
10919 __tmp.put_u16_le(self.counter);
10920 for val in &self.failure_flags {
10921 __tmp.put_u16_le(*val);
10922 }
10923 for val in &self.temperature {
10924 __tmp.put_i16_le(*val);
10925 }
10926 __tmp.put_u8(self.index);
10927 __tmp.put_u8(self.count);
10928 __tmp.put_u8(self.connection_type as u8);
10929 __tmp.put_u8(self.info);
10930 if matches!(version, MavlinkVersion::V2) {
10931 let len = __tmp.len();
10932 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10933 } else {
10934 __tmp.len()
10935 }
10936 }
10937}
10938#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
10939#[doc = ""]
10940#[doc = "ID: 291"]
10941#[derive(Debug, Clone, PartialEq)]
10942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10944pub struct ESC_STATUS_DATA {
10945 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10946 pub time_usec: u64,
10947 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
10948 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10949 pub rpm: [i32; 4],
10950 #[doc = "Voltage measured from each ESC."]
10951 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10952 pub voltage: [f32; 4],
10953 #[doc = "Current measured from each ESC."]
10954 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10955 pub current: [f32; 4],
10956 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10957 pub index: u8,
10958}
10959impl ESC_STATUS_DATA {
10960 pub const ENCODED_LEN: usize = 57usize;
10961 pub const DEFAULT: Self = Self {
10962 time_usec: 0_u64,
10963 rpm: [0_i32; 4usize],
10964 voltage: [0.0_f32; 4usize],
10965 current: [0.0_f32; 4usize],
10966 index: 0_u8,
10967 };
10968 #[cfg(feature = "arbitrary")]
10969 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10970 use arbitrary::{Arbitrary, Unstructured};
10971 let mut buf = [0u8; 1024];
10972 rng.fill_bytes(&mut buf);
10973 let mut unstructured = Unstructured::new(&buf);
10974 Self::arbitrary(&mut unstructured).unwrap_or_default()
10975 }
10976}
10977impl Default for ESC_STATUS_DATA {
10978 fn default() -> Self {
10979 Self::DEFAULT.clone()
10980 }
10981}
10982impl MessageData for ESC_STATUS_DATA {
10983 type Message = MavMessage;
10984 const ID: u32 = 291u32;
10985 const NAME: &'static str = "ESC_STATUS";
10986 const EXTRA_CRC: u8 = 10u8;
10987 const ENCODED_LEN: usize = 57usize;
10988 fn deser(
10989 _version: MavlinkVersion,
10990 __input: &[u8],
10991 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10992 let avail_len = __input.len();
10993 let mut payload_buf = [0; Self::ENCODED_LEN];
10994 let mut buf = if avail_len < Self::ENCODED_LEN {
10995 payload_buf[0..avail_len].copy_from_slice(__input);
10996 Bytes::new(&payload_buf)
10997 } else {
10998 Bytes::new(__input)
10999 };
11000 let mut __struct = Self::default();
11001 __struct.time_usec = buf.get_u64_le();
11002 for v in &mut __struct.rpm {
11003 let val = buf.get_i32_le();
11004 *v = val;
11005 }
11006 for v in &mut __struct.voltage {
11007 let val = buf.get_f32_le();
11008 *v = val;
11009 }
11010 for v in &mut __struct.current {
11011 let val = buf.get_f32_le();
11012 *v = val;
11013 }
11014 __struct.index = buf.get_u8();
11015 Ok(__struct)
11016 }
11017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11018 let mut __tmp = BytesMut::new(bytes);
11019 #[allow(clippy::absurd_extreme_comparisons)]
11020 #[allow(unused_comparisons)]
11021 if __tmp.remaining() < Self::ENCODED_LEN {
11022 panic!(
11023 "buffer is too small (need {} bytes, but got {})",
11024 Self::ENCODED_LEN,
11025 __tmp.remaining(),
11026 )
11027 }
11028 __tmp.put_u64_le(self.time_usec);
11029 for val in &self.rpm {
11030 __tmp.put_i32_le(*val);
11031 }
11032 for val in &self.voltage {
11033 __tmp.put_f32_le(*val);
11034 }
11035 for val in &self.current {
11036 __tmp.put_f32_le(*val);
11037 }
11038 __tmp.put_u8(self.index);
11039 if matches!(version, MavlinkVersion::V2) {
11040 let len = __tmp.len();
11041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11042 } else {
11043 __tmp.len()
11044 }
11045 }
11046}
11047#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11048#[doc = ""]
11049#[doc = "ID: 230"]
11050#[derive(Debug, Clone, PartialEq)]
11051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11053pub struct ESTIMATOR_STATUS_DATA {
11054 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11055 pub time_usec: u64,
11056 #[doc = "Velocity innovation test ratio"]
11057 pub vel_ratio: f32,
11058 #[doc = "Horizontal position innovation test ratio"]
11059 pub pos_horiz_ratio: f32,
11060 #[doc = "Vertical position innovation test ratio"]
11061 pub pos_vert_ratio: f32,
11062 #[doc = "Magnetometer innovation test ratio"]
11063 pub mag_ratio: f32,
11064 #[doc = "Height above terrain innovation test ratio"]
11065 pub hagl_ratio: f32,
11066 #[doc = "True airspeed innovation test ratio"]
11067 pub tas_ratio: f32,
11068 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11069 pub pos_horiz_accuracy: f32,
11070 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11071 pub pos_vert_accuracy: f32,
11072 #[doc = "Bitmap indicating which EKF outputs are valid."]
11073 pub flags: EstimatorStatusFlags,
11074}
11075impl ESTIMATOR_STATUS_DATA {
11076 pub const ENCODED_LEN: usize = 42usize;
11077 pub const DEFAULT: Self = Self {
11078 time_usec: 0_u64,
11079 vel_ratio: 0.0_f32,
11080 pos_horiz_ratio: 0.0_f32,
11081 pos_vert_ratio: 0.0_f32,
11082 mag_ratio: 0.0_f32,
11083 hagl_ratio: 0.0_f32,
11084 tas_ratio: 0.0_f32,
11085 pos_horiz_accuracy: 0.0_f32,
11086 pos_vert_accuracy: 0.0_f32,
11087 flags: EstimatorStatusFlags::DEFAULT,
11088 };
11089 #[cfg(feature = "arbitrary")]
11090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11091 use arbitrary::{Arbitrary, Unstructured};
11092 let mut buf = [0u8; 1024];
11093 rng.fill_bytes(&mut buf);
11094 let mut unstructured = Unstructured::new(&buf);
11095 Self::arbitrary(&mut unstructured).unwrap_or_default()
11096 }
11097}
11098impl Default for ESTIMATOR_STATUS_DATA {
11099 fn default() -> Self {
11100 Self::DEFAULT.clone()
11101 }
11102}
11103impl MessageData for ESTIMATOR_STATUS_DATA {
11104 type Message = MavMessage;
11105 const ID: u32 = 230u32;
11106 const NAME: &'static str = "ESTIMATOR_STATUS";
11107 const EXTRA_CRC: u8 = 163u8;
11108 const ENCODED_LEN: usize = 42usize;
11109 fn deser(
11110 _version: MavlinkVersion,
11111 __input: &[u8],
11112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11113 let avail_len = __input.len();
11114 let mut payload_buf = [0; Self::ENCODED_LEN];
11115 let mut buf = if avail_len < Self::ENCODED_LEN {
11116 payload_buf[0..avail_len].copy_from_slice(__input);
11117 Bytes::new(&payload_buf)
11118 } else {
11119 Bytes::new(__input)
11120 };
11121 let mut __struct = Self::default();
11122 __struct.time_usec = buf.get_u64_le();
11123 __struct.vel_ratio = buf.get_f32_le();
11124 __struct.pos_horiz_ratio = buf.get_f32_le();
11125 __struct.pos_vert_ratio = buf.get_f32_le();
11126 __struct.mag_ratio = buf.get_f32_le();
11127 __struct.hagl_ratio = buf.get_f32_le();
11128 __struct.tas_ratio = buf.get_f32_le();
11129 __struct.pos_horiz_accuracy = buf.get_f32_le();
11130 __struct.pos_vert_accuracy = buf.get_f32_le();
11131 let tmp = buf.get_u16_le();
11132 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11133 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11134 flag_type: "EstimatorStatusFlags",
11135 value: tmp as u32,
11136 })?;
11137 Ok(__struct)
11138 }
11139 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11140 let mut __tmp = BytesMut::new(bytes);
11141 #[allow(clippy::absurd_extreme_comparisons)]
11142 #[allow(unused_comparisons)]
11143 if __tmp.remaining() < Self::ENCODED_LEN {
11144 panic!(
11145 "buffer is too small (need {} bytes, but got {})",
11146 Self::ENCODED_LEN,
11147 __tmp.remaining(),
11148 )
11149 }
11150 __tmp.put_u64_le(self.time_usec);
11151 __tmp.put_f32_le(self.vel_ratio);
11152 __tmp.put_f32_le(self.pos_horiz_ratio);
11153 __tmp.put_f32_le(self.pos_vert_ratio);
11154 __tmp.put_f32_le(self.mag_ratio);
11155 __tmp.put_f32_le(self.hagl_ratio);
11156 __tmp.put_f32_le(self.tas_ratio);
11157 __tmp.put_f32_le(self.pos_horiz_accuracy);
11158 __tmp.put_f32_le(self.pos_vert_accuracy);
11159 __tmp.put_u16_le(self.flags.bits());
11160 if matches!(version, MavlinkVersion::V2) {
11161 let len = __tmp.len();
11162 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11163 } else {
11164 __tmp.len()
11165 }
11166 }
11167}
11168#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11169#[doc = ""]
11170#[doc = "ID: 410"]
11171#[derive(Debug, Clone, PartialEq)]
11172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11174pub struct EVENT_DATA {
11175 #[doc = "Event ID (as defined in the component metadata)"]
11176 pub id: u32,
11177 #[doc = "Timestamp (time since system boot when the event happened)."]
11178 pub event_time_boot_ms: u32,
11179 #[doc = "Sequence number."]
11180 pub sequence: u16,
11181 #[doc = "Component ID"]
11182 pub destination_component: u8,
11183 #[doc = "System ID"]
11184 pub destination_system: u8,
11185 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11186 pub log_levels: u8,
11187 #[doc = "Arguments (depend on event ID)."]
11188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11189 pub arguments: [u8; 40],
11190}
11191impl EVENT_DATA {
11192 pub const ENCODED_LEN: usize = 53usize;
11193 pub const DEFAULT: Self = Self {
11194 id: 0_u32,
11195 event_time_boot_ms: 0_u32,
11196 sequence: 0_u16,
11197 destination_component: 0_u8,
11198 destination_system: 0_u8,
11199 log_levels: 0_u8,
11200 arguments: [0_u8; 40usize],
11201 };
11202 #[cfg(feature = "arbitrary")]
11203 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11204 use arbitrary::{Arbitrary, Unstructured};
11205 let mut buf = [0u8; 1024];
11206 rng.fill_bytes(&mut buf);
11207 let mut unstructured = Unstructured::new(&buf);
11208 Self::arbitrary(&mut unstructured).unwrap_or_default()
11209 }
11210}
11211impl Default for EVENT_DATA {
11212 fn default() -> Self {
11213 Self::DEFAULT.clone()
11214 }
11215}
11216impl MessageData for EVENT_DATA {
11217 type Message = MavMessage;
11218 const ID: u32 = 410u32;
11219 const NAME: &'static str = "EVENT";
11220 const EXTRA_CRC: u8 = 160u8;
11221 const ENCODED_LEN: usize = 53usize;
11222 fn deser(
11223 _version: MavlinkVersion,
11224 __input: &[u8],
11225 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11226 let avail_len = __input.len();
11227 let mut payload_buf = [0; Self::ENCODED_LEN];
11228 let mut buf = if avail_len < Self::ENCODED_LEN {
11229 payload_buf[0..avail_len].copy_from_slice(__input);
11230 Bytes::new(&payload_buf)
11231 } else {
11232 Bytes::new(__input)
11233 };
11234 let mut __struct = Self::default();
11235 __struct.id = buf.get_u32_le();
11236 __struct.event_time_boot_ms = buf.get_u32_le();
11237 __struct.sequence = buf.get_u16_le();
11238 __struct.destination_component = buf.get_u8();
11239 __struct.destination_system = buf.get_u8();
11240 __struct.log_levels = buf.get_u8();
11241 for v in &mut __struct.arguments {
11242 let val = buf.get_u8();
11243 *v = val;
11244 }
11245 Ok(__struct)
11246 }
11247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11248 let mut __tmp = BytesMut::new(bytes);
11249 #[allow(clippy::absurd_extreme_comparisons)]
11250 #[allow(unused_comparisons)]
11251 if __tmp.remaining() < Self::ENCODED_LEN {
11252 panic!(
11253 "buffer is too small (need {} bytes, but got {})",
11254 Self::ENCODED_LEN,
11255 __tmp.remaining(),
11256 )
11257 }
11258 __tmp.put_u32_le(self.id);
11259 __tmp.put_u32_le(self.event_time_boot_ms);
11260 __tmp.put_u16_le(self.sequence);
11261 __tmp.put_u8(self.destination_component);
11262 __tmp.put_u8(self.destination_system);
11263 __tmp.put_u8(self.log_levels);
11264 for val in &self.arguments {
11265 __tmp.put_u8(*val);
11266 }
11267 if matches!(version, MavlinkVersion::V2) {
11268 let len = __tmp.len();
11269 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11270 } else {
11271 __tmp.len()
11272 }
11273 }
11274}
11275#[doc = "Provides state for additional features."]
11276#[doc = ""]
11277#[doc = "ID: 245"]
11278#[derive(Debug, Clone, PartialEq)]
11279#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11280#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11281pub struct EXTENDED_SYS_STATE_DATA {
11282 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11283 pub vtol_state: MavVtolState,
11284 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11285 pub landed_state: MavLandedState,
11286}
11287impl EXTENDED_SYS_STATE_DATA {
11288 pub const ENCODED_LEN: usize = 2usize;
11289 pub const DEFAULT: Self = Self {
11290 vtol_state: MavVtolState::DEFAULT,
11291 landed_state: MavLandedState::DEFAULT,
11292 };
11293 #[cfg(feature = "arbitrary")]
11294 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11295 use arbitrary::{Arbitrary, Unstructured};
11296 let mut buf = [0u8; 1024];
11297 rng.fill_bytes(&mut buf);
11298 let mut unstructured = Unstructured::new(&buf);
11299 Self::arbitrary(&mut unstructured).unwrap_or_default()
11300 }
11301}
11302impl Default for EXTENDED_SYS_STATE_DATA {
11303 fn default() -> Self {
11304 Self::DEFAULT.clone()
11305 }
11306}
11307impl MessageData for EXTENDED_SYS_STATE_DATA {
11308 type Message = MavMessage;
11309 const ID: u32 = 245u32;
11310 const NAME: &'static str = "EXTENDED_SYS_STATE";
11311 const EXTRA_CRC: u8 = 130u8;
11312 const ENCODED_LEN: usize = 2usize;
11313 fn deser(
11314 _version: MavlinkVersion,
11315 __input: &[u8],
11316 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11317 let avail_len = __input.len();
11318 let mut payload_buf = [0; Self::ENCODED_LEN];
11319 let mut buf = if avail_len < Self::ENCODED_LEN {
11320 payload_buf[0..avail_len].copy_from_slice(__input);
11321 Bytes::new(&payload_buf)
11322 } else {
11323 Bytes::new(__input)
11324 };
11325 let mut __struct = Self::default();
11326 let tmp = buf.get_u8();
11327 __struct.vtol_state =
11328 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11329 enum_type: "MavVtolState",
11330 value: tmp as u32,
11331 })?;
11332 let tmp = buf.get_u8();
11333 __struct.landed_state =
11334 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11335 enum_type: "MavLandedState",
11336 value: tmp as u32,
11337 })?;
11338 Ok(__struct)
11339 }
11340 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11341 let mut __tmp = BytesMut::new(bytes);
11342 #[allow(clippy::absurd_extreme_comparisons)]
11343 #[allow(unused_comparisons)]
11344 if __tmp.remaining() < Self::ENCODED_LEN {
11345 panic!(
11346 "buffer is too small (need {} bytes, but got {})",
11347 Self::ENCODED_LEN,
11348 __tmp.remaining(),
11349 )
11350 }
11351 __tmp.put_u8(self.vtol_state as u8);
11352 __tmp.put_u8(self.landed_state as u8);
11353 if matches!(version, MavlinkVersion::V2) {
11354 let len = __tmp.len();
11355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11356 } else {
11357 __tmp.len()
11358 }
11359 }
11360}
11361#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11362#[doc = ""]
11363#[doc = "ID: 162"]
11364#[derive(Debug, Clone, PartialEq)]
11365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11367pub struct FENCE_STATUS_DATA {
11368 #[doc = "Time (since boot) of last breach."]
11369 pub breach_time: u32,
11370 #[doc = "Number of fence breaches."]
11371 pub breach_count: u16,
11372 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11373 pub breach_status: u8,
11374 #[doc = "Last breach type."]
11375 pub breach_type: FenceBreach,
11376 #[doc = "Active action to prevent fence breach"]
11377 #[cfg_attr(feature = "serde", serde(default))]
11378 pub breach_mitigation: FenceMitigate,
11379}
11380impl FENCE_STATUS_DATA {
11381 pub const ENCODED_LEN: usize = 9usize;
11382 pub const DEFAULT: Self = Self {
11383 breach_time: 0_u32,
11384 breach_count: 0_u16,
11385 breach_status: 0_u8,
11386 breach_type: FenceBreach::DEFAULT,
11387 breach_mitigation: FenceMitigate::DEFAULT,
11388 };
11389 #[cfg(feature = "arbitrary")]
11390 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11391 use arbitrary::{Arbitrary, Unstructured};
11392 let mut buf = [0u8; 1024];
11393 rng.fill_bytes(&mut buf);
11394 let mut unstructured = Unstructured::new(&buf);
11395 Self::arbitrary(&mut unstructured).unwrap_or_default()
11396 }
11397}
11398impl Default for FENCE_STATUS_DATA {
11399 fn default() -> Self {
11400 Self::DEFAULT.clone()
11401 }
11402}
11403impl MessageData for FENCE_STATUS_DATA {
11404 type Message = MavMessage;
11405 const ID: u32 = 162u32;
11406 const NAME: &'static str = "FENCE_STATUS";
11407 const EXTRA_CRC: u8 = 189u8;
11408 const ENCODED_LEN: usize = 9usize;
11409 fn deser(
11410 _version: MavlinkVersion,
11411 __input: &[u8],
11412 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11413 let avail_len = __input.len();
11414 let mut payload_buf = [0; Self::ENCODED_LEN];
11415 let mut buf = if avail_len < Self::ENCODED_LEN {
11416 payload_buf[0..avail_len].copy_from_slice(__input);
11417 Bytes::new(&payload_buf)
11418 } else {
11419 Bytes::new(__input)
11420 };
11421 let mut __struct = Self::default();
11422 __struct.breach_time = buf.get_u32_le();
11423 __struct.breach_count = buf.get_u16_le();
11424 __struct.breach_status = buf.get_u8();
11425 let tmp = buf.get_u8();
11426 __struct.breach_type =
11427 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11428 enum_type: "FenceBreach",
11429 value: tmp as u32,
11430 })?;
11431 let tmp = buf.get_u8();
11432 __struct.breach_mitigation =
11433 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11434 enum_type: "FenceMitigate",
11435 value: tmp as u32,
11436 })?;
11437 Ok(__struct)
11438 }
11439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11440 let mut __tmp = BytesMut::new(bytes);
11441 #[allow(clippy::absurd_extreme_comparisons)]
11442 #[allow(unused_comparisons)]
11443 if __tmp.remaining() < Self::ENCODED_LEN {
11444 panic!(
11445 "buffer is too small (need {} bytes, but got {})",
11446 Self::ENCODED_LEN,
11447 __tmp.remaining(),
11448 )
11449 }
11450 __tmp.put_u32_le(self.breach_time);
11451 __tmp.put_u16_le(self.breach_count);
11452 __tmp.put_u8(self.breach_status);
11453 __tmp.put_u8(self.breach_type as u8);
11454 if matches!(version, MavlinkVersion::V2) {
11455 __tmp.put_u8(self.breach_mitigation as u8);
11456 let len = __tmp.len();
11457 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11458 } else {
11459 __tmp.len()
11460 }
11461 }
11462}
11463#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11464#[doc = ""]
11465#[doc = "ID: 110"]
11466#[derive(Debug, Clone, PartialEq)]
11467#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11468#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11469pub struct FILE_TRANSFER_PROTOCOL_DATA {
11470 #[doc = "Network ID (0 for broadcast)"]
11471 pub target_network: u8,
11472 #[doc = "System ID (0 for broadcast)"]
11473 pub target_system: u8,
11474 #[doc = "Component ID (0 for broadcast)"]
11475 pub target_component: u8,
11476 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11478 pub payload: [u8; 251],
11479}
11480impl FILE_TRANSFER_PROTOCOL_DATA {
11481 pub const ENCODED_LEN: usize = 254usize;
11482 pub const DEFAULT: Self = Self {
11483 target_network: 0_u8,
11484 target_system: 0_u8,
11485 target_component: 0_u8,
11486 payload: [0_u8; 251usize],
11487 };
11488 #[cfg(feature = "arbitrary")]
11489 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11490 use arbitrary::{Arbitrary, Unstructured};
11491 let mut buf = [0u8; 1024];
11492 rng.fill_bytes(&mut buf);
11493 let mut unstructured = Unstructured::new(&buf);
11494 Self::arbitrary(&mut unstructured).unwrap_or_default()
11495 }
11496}
11497impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11498 fn default() -> Self {
11499 Self::DEFAULT.clone()
11500 }
11501}
11502impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11503 type Message = MavMessage;
11504 const ID: u32 = 110u32;
11505 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11506 const EXTRA_CRC: u8 = 84u8;
11507 const ENCODED_LEN: usize = 254usize;
11508 fn deser(
11509 _version: MavlinkVersion,
11510 __input: &[u8],
11511 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11512 let avail_len = __input.len();
11513 let mut payload_buf = [0; Self::ENCODED_LEN];
11514 let mut buf = if avail_len < Self::ENCODED_LEN {
11515 payload_buf[0..avail_len].copy_from_slice(__input);
11516 Bytes::new(&payload_buf)
11517 } else {
11518 Bytes::new(__input)
11519 };
11520 let mut __struct = Self::default();
11521 __struct.target_network = buf.get_u8();
11522 __struct.target_system = buf.get_u8();
11523 __struct.target_component = buf.get_u8();
11524 for v in &mut __struct.payload {
11525 let val = buf.get_u8();
11526 *v = val;
11527 }
11528 Ok(__struct)
11529 }
11530 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11531 let mut __tmp = BytesMut::new(bytes);
11532 #[allow(clippy::absurd_extreme_comparisons)]
11533 #[allow(unused_comparisons)]
11534 if __tmp.remaining() < Self::ENCODED_LEN {
11535 panic!(
11536 "buffer is too small (need {} bytes, but got {})",
11537 Self::ENCODED_LEN,
11538 __tmp.remaining(),
11539 )
11540 }
11541 __tmp.put_u8(self.target_network);
11542 __tmp.put_u8(self.target_system);
11543 __tmp.put_u8(self.target_component);
11544 for val in &self.payload {
11545 __tmp.put_u8(*val);
11546 }
11547 if matches!(version, MavlinkVersion::V2) {
11548 let len = __tmp.len();
11549 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11550 } else {
11551 __tmp.len()
11552 }
11553 }
11554}
11555#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11556#[doc = ""]
11557#[doc = "ID: 264"]
11558#[derive(Debug, Clone, PartialEq)]
11559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11561pub struct FLIGHT_INFORMATION_DATA {
11562 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11563 pub arming_time_utc: u64,
11564 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11565 pub takeoff_time_utc: u64,
11566 #[doc = "Flight number. Note, field is misnamed UUID."]
11567 pub flight_uuid: u64,
11568 #[doc = "Timestamp (time since system boot)."]
11569 pub time_boot_ms: u32,
11570 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11571 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11572 pub landing_time: u32,
11573}
11574impl FLIGHT_INFORMATION_DATA {
11575 pub const ENCODED_LEN: usize = 32usize;
11576 pub const DEFAULT: Self = Self {
11577 arming_time_utc: 0_u64,
11578 takeoff_time_utc: 0_u64,
11579 flight_uuid: 0_u64,
11580 time_boot_ms: 0_u32,
11581 landing_time: 0_u32,
11582 };
11583 #[cfg(feature = "arbitrary")]
11584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11585 use arbitrary::{Arbitrary, Unstructured};
11586 let mut buf = [0u8; 1024];
11587 rng.fill_bytes(&mut buf);
11588 let mut unstructured = Unstructured::new(&buf);
11589 Self::arbitrary(&mut unstructured).unwrap_or_default()
11590 }
11591}
11592impl Default for FLIGHT_INFORMATION_DATA {
11593 fn default() -> Self {
11594 Self::DEFAULT.clone()
11595 }
11596}
11597impl MessageData for FLIGHT_INFORMATION_DATA {
11598 type Message = MavMessage;
11599 const ID: u32 = 264u32;
11600 const NAME: &'static str = "FLIGHT_INFORMATION";
11601 const EXTRA_CRC: u8 = 49u8;
11602 const ENCODED_LEN: usize = 32usize;
11603 fn deser(
11604 _version: MavlinkVersion,
11605 __input: &[u8],
11606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11607 let avail_len = __input.len();
11608 let mut payload_buf = [0; Self::ENCODED_LEN];
11609 let mut buf = if avail_len < Self::ENCODED_LEN {
11610 payload_buf[0..avail_len].copy_from_slice(__input);
11611 Bytes::new(&payload_buf)
11612 } else {
11613 Bytes::new(__input)
11614 };
11615 let mut __struct = Self::default();
11616 __struct.arming_time_utc = buf.get_u64_le();
11617 __struct.takeoff_time_utc = buf.get_u64_le();
11618 __struct.flight_uuid = buf.get_u64_le();
11619 __struct.time_boot_ms = buf.get_u32_le();
11620 __struct.landing_time = buf.get_u32_le();
11621 Ok(__struct)
11622 }
11623 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11624 let mut __tmp = BytesMut::new(bytes);
11625 #[allow(clippy::absurd_extreme_comparisons)]
11626 #[allow(unused_comparisons)]
11627 if __tmp.remaining() < Self::ENCODED_LEN {
11628 panic!(
11629 "buffer is too small (need {} bytes, but got {})",
11630 Self::ENCODED_LEN,
11631 __tmp.remaining(),
11632 )
11633 }
11634 __tmp.put_u64_le(self.arming_time_utc);
11635 __tmp.put_u64_le(self.takeoff_time_utc);
11636 __tmp.put_u64_le(self.flight_uuid);
11637 __tmp.put_u32_le(self.time_boot_ms);
11638 if matches!(version, MavlinkVersion::V2) {
11639 __tmp.put_u32_le(self.landing_time);
11640 let len = __tmp.len();
11641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11642 } else {
11643 __tmp.len()
11644 }
11645 }
11646}
11647#[doc = "Current motion information from a designated system."]
11648#[doc = ""]
11649#[doc = "ID: 144"]
11650#[derive(Debug, Clone, PartialEq)]
11651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11652#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11653pub struct FOLLOW_TARGET_DATA {
11654 #[doc = "Timestamp (time since system boot)."]
11655 pub timestamp: u64,
11656 #[doc = "button states or switches of a tracker device"]
11657 pub custom_state: u64,
11658 #[doc = "Latitude (WGS84)"]
11659 pub lat: i32,
11660 #[doc = "Longitude (WGS84)"]
11661 pub lon: i32,
11662 #[doc = "Altitude (MSL)"]
11663 pub alt: f32,
11664 #[doc = "target velocity (0,0,0) for unknown"]
11665 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11666 pub vel: [f32; 3],
11667 #[doc = "linear target acceleration (0,0,0) for unknown"]
11668 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11669 pub acc: [f32; 3],
11670 #[doc = "(0 0 0 0 for unknown)"]
11671 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11672 pub attitude_q: [f32; 4],
11673 #[doc = "(0 0 0 for unknown)"]
11674 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11675 pub rates: [f32; 3],
11676 #[doc = "eph epv"]
11677 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11678 pub position_cov: [f32; 3],
11679 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11680 pub est_capabilities: u8,
11681}
11682impl FOLLOW_TARGET_DATA {
11683 pub const ENCODED_LEN: usize = 93usize;
11684 pub const DEFAULT: Self = Self {
11685 timestamp: 0_u64,
11686 custom_state: 0_u64,
11687 lat: 0_i32,
11688 lon: 0_i32,
11689 alt: 0.0_f32,
11690 vel: [0.0_f32; 3usize],
11691 acc: [0.0_f32; 3usize],
11692 attitude_q: [0.0_f32; 4usize],
11693 rates: [0.0_f32; 3usize],
11694 position_cov: [0.0_f32; 3usize],
11695 est_capabilities: 0_u8,
11696 };
11697 #[cfg(feature = "arbitrary")]
11698 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11699 use arbitrary::{Arbitrary, Unstructured};
11700 let mut buf = [0u8; 1024];
11701 rng.fill_bytes(&mut buf);
11702 let mut unstructured = Unstructured::new(&buf);
11703 Self::arbitrary(&mut unstructured).unwrap_or_default()
11704 }
11705}
11706impl Default for FOLLOW_TARGET_DATA {
11707 fn default() -> Self {
11708 Self::DEFAULT.clone()
11709 }
11710}
11711impl MessageData for FOLLOW_TARGET_DATA {
11712 type Message = MavMessage;
11713 const ID: u32 = 144u32;
11714 const NAME: &'static str = "FOLLOW_TARGET";
11715 const EXTRA_CRC: u8 = 127u8;
11716 const ENCODED_LEN: usize = 93usize;
11717 fn deser(
11718 _version: MavlinkVersion,
11719 __input: &[u8],
11720 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11721 let avail_len = __input.len();
11722 let mut payload_buf = [0; Self::ENCODED_LEN];
11723 let mut buf = if avail_len < Self::ENCODED_LEN {
11724 payload_buf[0..avail_len].copy_from_slice(__input);
11725 Bytes::new(&payload_buf)
11726 } else {
11727 Bytes::new(__input)
11728 };
11729 let mut __struct = Self::default();
11730 __struct.timestamp = buf.get_u64_le();
11731 __struct.custom_state = buf.get_u64_le();
11732 __struct.lat = buf.get_i32_le();
11733 __struct.lon = buf.get_i32_le();
11734 __struct.alt = buf.get_f32_le();
11735 for v in &mut __struct.vel {
11736 let val = buf.get_f32_le();
11737 *v = val;
11738 }
11739 for v in &mut __struct.acc {
11740 let val = buf.get_f32_le();
11741 *v = val;
11742 }
11743 for v in &mut __struct.attitude_q {
11744 let val = buf.get_f32_le();
11745 *v = val;
11746 }
11747 for v in &mut __struct.rates {
11748 let val = buf.get_f32_le();
11749 *v = val;
11750 }
11751 for v in &mut __struct.position_cov {
11752 let val = buf.get_f32_le();
11753 *v = val;
11754 }
11755 __struct.est_capabilities = buf.get_u8();
11756 Ok(__struct)
11757 }
11758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11759 let mut __tmp = BytesMut::new(bytes);
11760 #[allow(clippy::absurd_extreme_comparisons)]
11761 #[allow(unused_comparisons)]
11762 if __tmp.remaining() < Self::ENCODED_LEN {
11763 panic!(
11764 "buffer is too small (need {} bytes, but got {})",
11765 Self::ENCODED_LEN,
11766 __tmp.remaining(),
11767 )
11768 }
11769 __tmp.put_u64_le(self.timestamp);
11770 __tmp.put_u64_le(self.custom_state);
11771 __tmp.put_i32_le(self.lat);
11772 __tmp.put_i32_le(self.lon);
11773 __tmp.put_f32_le(self.alt);
11774 for val in &self.vel {
11775 __tmp.put_f32_le(*val);
11776 }
11777 for val in &self.acc {
11778 __tmp.put_f32_le(*val);
11779 }
11780 for val in &self.attitude_q {
11781 __tmp.put_f32_le(*val);
11782 }
11783 for val in &self.rates {
11784 __tmp.put_f32_le(*val);
11785 }
11786 for val in &self.position_cov {
11787 __tmp.put_f32_le(*val);
11788 }
11789 __tmp.put_u8(self.est_capabilities);
11790 if matches!(version, MavlinkVersion::V2) {
11791 let len = __tmp.len();
11792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11793 } else {
11794 __tmp.len()
11795 }
11796 }
11797}
11798#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
11799#[doc = ""]
11800#[doc = "ID: 371"]
11801#[derive(Debug, Clone, PartialEq)]
11802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11804pub struct FUEL_STATUS_DATA {
11805 #[doc = "Capacity when full. Must be provided."]
11806 pub maximum_fuel: f32,
11807 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11808 pub consumed_fuel: f32,
11809 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11810 pub remaining_fuel: f32,
11811 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
11812 pub flow_rate: f32,
11813 #[doc = "Fuel temperature. NaN: field not provided."]
11814 pub temperature: f32,
11815 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
11816 pub fuel_type: MavFuelType,
11817 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
11818 pub id: u8,
11819 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
11820 pub percent_remaining: u8,
11821}
11822impl FUEL_STATUS_DATA {
11823 pub const ENCODED_LEN: usize = 26usize;
11824 pub const DEFAULT: Self = Self {
11825 maximum_fuel: 0.0_f32,
11826 consumed_fuel: 0.0_f32,
11827 remaining_fuel: 0.0_f32,
11828 flow_rate: 0.0_f32,
11829 temperature: 0.0_f32,
11830 fuel_type: MavFuelType::DEFAULT,
11831 id: 0_u8,
11832 percent_remaining: 0_u8,
11833 };
11834 #[cfg(feature = "arbitrary")]
11835 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11836 use arbitrary::{Arbitrary, Unstructured};
11837 let mut buf = [0u8; 1024];
11838 rng.fill_bytes(&mut buf);
11839 let mut unstructured = Unstructured::new(&buf);
11840 Self::arbitrary(&mut unstructured).unwrap_or_default()
11841 }
11842}
11843impl Default for FUEL_STATUS_DATA {
11844 fn default() -> Self {
11845 Self::DEFAULT.clone()
11846 }
11847}
11848impl MessageData for FUEL_STATUS_DATA {
11849 type Message = MavMessage;
11850 const ID: u32 = 371u32;
11851 const NAME: &'static str = "FUEL_STATUS";
11852 const EXTRA_CRC: u8 = 10u8;
11853 const ENCODED_LEN: usize = 26usize;
11854 fn deser(
11855 _version: MavlinkVersion,
11856 __input: &[u8],
11857 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11858 let avail_len = __input.len();
11859 let mut payload_buf = [0; Self::ENCODED_LEN];
11860 let mut buf = if avail_len < Self::ENCODED_LEN {
11861 payload_buf[0..avail_len].copy_from_slice(__input);
11862 Bytes::new(&payload_buf)
11863 } else {
11864 Bytes::new(__input)
11865 };
11866 let mut __struct = Self::default();
11867 __struct.maximum_fuel = buf.get_f32_le();
11868 __struct.consumed_fuel = buf.get_f32_le();
11869 __struct.remaining_fuel = buf.get_f32_le();
11870 __struct.flow_rate = buf.get_f32_le();
11871 __struct.temperature = buf.get_f32_le();
11872 let tmp = buf.get_u32_le();
11873 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
11874 ::mavlink_core::error::ParserError::InvalidEnum {
11875 enum_type: "MavFuelType",
11876 value: tmp as u32,
11877 },
11878 )?;
11879 __struct.id = buf.get_u8();
11880 __struct.percent_remaining = buf.get_u8();
11881 Ok(__struct)
11882 }
11883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11884 let mut __tmp = BytesMut::new(bytes);
11885 #[allow(clippy::absurd_extreme_comparisons)]
11886 #[allow(unused_comparisons)]
11887 if __tmp.remaining() < Self::ENCODED_LEN {
11888 panic!(
11889 "buffer is too small (need {} bytes, but got {})",
11890 Self::ENCODED_LEN,
11891 __tmp.remaining(),
11892 )
11893 }
11894 __tmp.put_f32_le(self.maximum_fuel);
11895 __tmp.put_f32_le(self.consumed_fuel);
11896 __tmp.put_f32_le(self.remaining_fuel);
11897 __tmp.put_f32_le(self.flow_rate);
11898 __tmp.put_f32_le(self.temperature);
11899 __tmp.put_u32_le(self.fuel_type as u32);
11900 __tmp.put_u8(self.id);
11901 __tmp.put_u8(self.percent_remaining);
11902 if matches!(version, MavlinkVersion::V2) {
11903 let len = __tmp.len();
11904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11905 } else {
11906 __tmp.len()
11907 }
11908 }
11909}
11910#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
11911#[doc = ""]
11912#[doc = "ID: 373"]
11913#[derive(Debug, Clone, PartialEq)]
11914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11916pub struct GENERATOR_STATUS_DATA {
11917 #[doc = "Status flags."]
11918 pub status: MavGeneratorStatusFlag,
11919 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
11920 pub battery_current: f32,
11921 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
11922 pub load_current: f32,
11923 #[doc = "The power being generated. NaN: field not provided"]
11924 pub power_generated: f32,
11925 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
11926 pub bus_voltage: f32,
11927 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
11928 pub bat_current_setpoint: f32,
11929 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
11930 pub runtime: u32,
11931 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
11932 pub time_until_maintenance: i32,
11933 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
11934 pub generator_speed: u16,
11935 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
11936 pub rectifier_temperature: i16,
11937 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
11938 pub generator_temperature: i16,
11939}
11940impl GENERATOR_STATUS_DATA {
11941 pub const ENCODED_LEN: usize = 42usize;
11942 pub const DEFAULT: Self = Self {
11943 status: MavGeneratorStatusFlag::DEFAULT,
11944 battery_current: 0.0_f32,
11945 load_current: 0.0_f32,
11946 power_generated: 0.0_f32,
11947 bus_voltage: 0.0_f32,
11948 bat_current_setpoint: 0.0_f32,
11949 runtime: 0_u32,
11950 time_until_maintenance: 0_i32,
11951 generator_speed: 0_u16,
11952 rectifier_temperature: 0_i16,
11953 generator_temperature: 0_i16,
11954 };
11955 #[cfg(feature = "arbitrary")]
11956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11957 use arbitrary::{Arbitrary, Unstructured};
11958 let mut buf = [0u8; 1024];
11959 rng.fill_bytes(&mut buf);
11960 let mut unstructured = Unstructured::new(&buf);
11961 Self::arbitrary(&mut unstructured).unwrap_or_default()
11962 }
11963}
11964impl Default for GENERATOR_STATUS_DATA {
11965 fn default() -> Self {
11966 Self::DEFAULT.clone()
11967 }
11968}
11969impl MessageData for GENERATOR_STATUS_DATA {
11970 type Message = MavMessage;
11971 const ID: u32 = 373u32;
11972 const NAME: &'static str = "GENERATOR_STATUS";
11973 const EXTRA_CRC: u8 = 117u8;
11974 const ENCODED_LEN: usize = 42usize;
11975 fn deser(
11976 _version: MavlinkVersion,
11977 __input: &[u8],
11978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11979 let avail_len = __input.len();
11980 let mut payload_buf = [0; Self::ENCODED_LEN];
11981 let mut buf = if avail_len < Self::ENCODED_LEN {
11982 payload_buf[0..avail_len].copy_from_slice(__input);
11983 Bytes::new(&payload_buf)
11984 } else {
11985 Bytes::new(__input)
11986 };
11987 let mut __struct = Self::default();
11988 let tmp = buf.get_u64_le();
11989 __struct.status = MavGeneratorStatusFlag::from_bits(
11990 tmp & MavGeneratorStatusFlag::all().bits(),
11991 )
11992 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11993 flag_type: "MavGeneratorStatusFlag",
11994 value: tmp as u32,
11995 })?;
11996 __struct.battery_current = buf.get_f32_le();
11997 __struct.load_current = buf.get_f32_le();
11998 __struct.power_generated = buf.get_f32_le();
11999 __struct.bus_voltage = buf.get_f32_le();
12000 __struct.bat_current_setpoint = buf.get_f32_le();
12001 __struct.runtime = buf.get_u32_le();
12002 __struct.time_until_maintenance = buf.get_i32_le();
12003 __struct.generator_speed = buf.get_u16_le();
12004 __struct.rectifier_temperature = buf.get_i16_le();
12005 __struct.generator_temperature = buf.get_i16_le();
12006 Ok(__struct)
12007 }
12008 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12009 let mut __tmp = BytesMut::new(bytes);
12010 #[allow(clippy::absurd_extreme_comparisons)]
12011 #[allow(unused_comparisons)]
12012 if __tmp.remaining() < Self::ENCODED_LEN {
12013 panic!(
12014 "buffer is too small (need {} bytes, but got {})",
12015 Self::ENCODED_LEN,
12016 __tmp.remaining(),
12017 )
12018 }
12019 __tmp.put_u64_le(self.status.bits());
12020 __tmp.put_f32_le(self.battery_current);
12021 __tmp.put_f32_le(self.load_current);
12022 __tmp.put_f32_le(self.power_generated);
12023 __tmp.put_f32_le(self.bus_voltage);
12024 __tmp.put_f32_le(self.bat_current_setpoint);
12025 __tmp.put_u32_le(self.runtime);
12026 __tmp.put_i32_le(self.time_until_maintenance);
12027 __tmp.put_u16_le(self.generator_speed);
12028 __tmp.put_i16_le(self.rectifier_temperature);
12029 __tmp.put_i16_le(self.generator_temperature);
12030 if matches!(version, MavlinkVersion::V2) {
12031 let len = __tmp.len();
12032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12033 } else {
12034 __tmp.len()
12035 }
12036 }
12037}
12038#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12039#[doc = ""]
12040#[doc = "ID: 285"]
12041#[derive(Debug, Clone, PartialEq)]
12042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12044pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12045 #[doc = "Timestamp (time since system boot)."]
12046 pub time_boot_ms: u32,
12047 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12049 pub q: [f32; 4],
12050 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12051 pub angular_velocity_x: f32,
12052 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12053 pub angular_velocity_y: f32,
12054 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12055 pub angular_velocity_z: f32,
12056 #[doc = "Failure flags (0 for no failure)"]
12057 pub failure_flags: GimbalDeviceErrorFlags,
12058 #[doc = "Current gimbal flags set."]
12059 pub flags: GimbalDeviceFlags,
12060 #[doc = "System ID"]
12061 pub target_system: u8,
12062 #[doc = "Component ID"]
12063 pub target_component: u8,
12064 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12065 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12066 pub delta_yaw: f32,
12067 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12068 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12069 pub delta_yaw_velocity: f32,
12070 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12071 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12072 pub gimbal_device_id: u8,
12073}
12074impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12075 pub const ENCODED_LEN: usize = 49usize;
12076 pub const DEFAULT: Self = Self {
12077 time_boot_ms: 0_u32,
12078 q: [0.0_f32; 4usize],
12079 angular_velocity_x: 0.0_f32,
12080 angular_velocity_y: 0.0_f32,
12081 angular_velocity_z: 0.0_f32,
12082 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12083 flags: GimbalDeviceFlags::DEFAULT,
12084 target_system: 0_u8,
12085 target_component: 0_u8,
12086 delta_yaw: 0.0_f32,
12087 delta_yaw_velocity: 0.0_f32,
12088 gimbal_device_id: 0_u8,
12089 };
12090 #[cfg(feature = "arbitrary")]
12091 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12092 use arbitrary::{Arbitrary, Unstructured};
12093 let mut buf = [0u8; 1024];
12094 rng.fill_bytes(&mut buf);
12095 let mut unstructured = Unstructured::new(&buf);
12096 Self::arbitrary(&mut unstructured).unwrap_or_default()
12097 }
12098}
12099impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12100 fn default() -> Self {
12101 Self::DEFAULT.clone()
12102 }
12103}
12104impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12105 type Message = MavMessage;
12106 const ID: u32 = 285u32;
12107 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12108 const EXTRA_CRC: u8 = 137u8;
12109 const ENCODED_LEN: usize = 49usize;
12110 fn deser(
12111 _version: MavlinkVersion,
12112 __input: &[u8],
12113 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12114 let avail_len = __input.len();
12115 let mut payload_buf = [0; Self::ENCODED_LEN];
12116 let mut buf = if avail_len < Self::ENCODED_LEN {
12117 payload_buf[0..avail_len].copy_from_slice(__input);
12118 Bytes::new(&payload_buf)
12119 } else {
12120 Bytes::new(__input)
12121 };
12122 let mut __struct = Self::default();
12123 __struct.time_boot_ms = buf.get_u32_le();
12124 for v in &mut __struct.q {
12125 let val = buf.get_f32_le();
12126 *v = val;
12127 }
12128 __struct.angular_velocity_x = buf.get_f32_le();
12129 __struct.angular_velocity_y = buf.get_f32_le();
12130 __struct.angular_velocity_z = buf.get_f32_le();
12131 let tmp = buf.get_u32_le();
12132 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12133 tmp & GimbalDeviceErrorFlags::all().bits(),
12134 )
12135 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12136 flag_type: "GimbalDeviceErrorFlags",
12137 value: tmp as u32,
12138 })?;
12139 let tmp = buf.get_u16_le();
12140 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12141 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12142 flag_type: "GimbalDeviceFlags",
12143 value: tmp as u32,
12144 })?;
12145 __struct.target_system = buf.get_u8();
12146 __struct.target_component = buf.get_u8();
12147 __struct.delta_yaw = buf.get_f32_le();
12148 __struct.delta_yaw_velocity = buf.get_f32_le();
12149 __struct.gimbal_device_id = buf.get_u8();
12150 Ok(__struct)
12151 }
12152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12153 let mut __tmp = BytesMut::new(bytes);
12154 #[allow(clippy::absurd_extreme_comparisons)]
12155 #[allow(unused_comparisons)]
12156 if __tmp.remaining() < Self::ENCODED_LEN {
12157 panic!(
12158 "buffer is too small (need {} bytes, but got {})",
12159 Self::ENCODED_LEN,
12160 __tmp.remaining(),
12161 )
12162 }
12163 __tmp.put_u32_le(self.time_boot_ms);
12164 for val in &self.q {
12165 __tmp.put_f32_le(*val);
12166 }
12167 __tmp.put_f32_le(self.angular_velocity_x);
12168 __tmp.put_f32_le(self.angular_velocity_y);
12169 __tmp.put_f32_le(self.angular_velocity_z);
12170 __tmp.put_u32_le(self.failure_flags.bits());
12171 __tmp.put_u16_le(self.flags.bits());
12172 __tmp.put_u8(self.target_system);
12173 __tmp.put_u8(self.target_component);
12174 if matches!(version, MavlinkVersion::V2) {
12175 __tmp.put_f32_le(self.delta_yaw);
12176 __tmp.put_f32_le(self.delta_yaw_velocity);
12177 __tmp.put_u8(self.gimbal_device_id);
12178 let len = __tmp.len();
12179 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12180 } else {
12181 __tmp.len()
12182 }
12183 }
12184}
12185#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12186#[doc = ""]
12187#[doc = "ID: 283"]
12188#[derive(Debug, Clone, PartialEq)]
12189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12190#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12191pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12192 #[doc = "UID of gimbal hardware (0 if unknown)."]
12193 pub uid: u64,
12194 #[doc = "Timestamp (time since system boot)."]
12195 pub time_boot_ms: u32,
12196 #[doc = "0xff)."]
12197 pub firmware_version: u32,
12198 #[doc = "0xff)."]
12199 pub hardware_version: u32,
12200 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12201 pub roll_min: f32,
12202 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12203 pub roll_max: f32,
12204 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12205 pub pitch_min: f32,
12206 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12207 pub pitch_max: f32,
12208 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12209 pub yaw_min: f32,
12210 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12211 pub yaw_max: f32,
12212 #[doc = "Bitmap of gimbal capability flags."]
12213 pub cap_flags: GimbalDeviceCapFlags,
12214 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12215 pub custom_cap_flags: u16,
12216 #[doc = "Name of the gimbal vendor."]
12217 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12218 pub vendor_name: [u8; 32],
12219 #[doc = "Name of the gimbal model."]
12220 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12221 pub model_name: [u8; 32],
12222 #[doc = "Custom name of the gimbal given to it by the user."]
12223 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12224 pub custom_name: [u8; 32],
12225 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12226 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12227 pub gimbal_device_id: u8,
12228}
12229impl GIMBAL_DEVICE_INFORMATION_DATA {
12230 pub const ENCODED_LEN: usize = 145usize;
12231 pub const DEFAULT: Self = Self {
12232 uid: 0_u64,
12233 time_boot_ms: 0_u32,
12234 firmware_version: 0_u32,
12235 hardware_version: 0_u32,
12236 roll_min: 0.0_f32,
12237 roll_max: 0.0_f32,
12238 pitch_min: 0.0_f32,
12239 pitch_max: 0.0_f32,
12240 yaw_min: 0.0_f32,
12241 yaw_max: 0.0_f32,
12242 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12243 custom_cap_flags: 0_u16,
12244 vendor_name: [0_u8; 32usize],
12245 model_name: [0_u8; 32usize],
12246 custom_name: [0_u8; 32usize],
12247 gimbal_device_id: 0_u8,
12248 };
12249 #[cfg(feature = "arbitrary")]
12250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12251 use arbitrary::{Arbitrary, Unstructured};
12252 let mut buf = [0u8; 1024];
12253 rng.fill_bytes(&mut buf);
12254 let mut unstructured = Unstructured::new(&buf);
12255 Self::arbitrary(&mut unstructured).unwrap_or_default()
12256 }
12257}
12258impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12259 fn default() -> Self {
12260 Self::DEFAULT.clone()
12261 }
12262}
12263impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12264 type Message = MavMessage;
12265 const ID: u32 = 283u32;
12266 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12267 const EXTRA_CRC: u8 = 74u8;
12268 const ENCODED_LEN: usize = 145usize;
12269 fn deser(
12270 _version: MavlinkVersion,
12271 __input: &[u8],
12272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12273 let avail_len = __input.len();
12274 let mut payload_buf = [0; Self::ENCODED_LEN];
12275 let mut buf = if avail_len < Self::ENCODED_LEN {
12276 payload_buf[0..avail_len].copy_from_slice(__input);
12277 Bytes::new(&payload_buf)
12278 } else {
12279 Bytes::new(__input)
12280 };
12281 let mut __struct = Self::default();
12282 __struct.uid = buf.get_u64_le();
12283 __struct.time_boot_ms = buf.get_u32_le();
12284 __struct.firmware_version = buf.get_u32_le();
12285 __struct.hardware_version = buf.get_u32_le();
12286 __struct.roll_min = buf.get_f32_le();
12287 __struct.roll_max = buf.get_f32_le();
12288 __struct.pitch_min = buf.get_f32_le();
12289 __struct.pitch_max = buf.get_f32_le();
12290 __struct.yaw_min = buf.get_f32_le();
12291 __struct.yaw_max = buf.get_f32_le();
12292 let tmp = buf.get_u16_le();
12293 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12294 tmp & GimbalDeviceCapFlags::all().bits(),
12295 )
12296 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12297 flag_type: "GimbalDeviceCapFlags",
12298 value: tmp as u32,
12299 })?;
12300 __struct.custom_cap_flags = buf.get_u16_le();
12301 for v in &mut __struct.vendor_name {
12302 let val = buf.get_u8();
12303 *v = val;
12304 }
12305 for v in &mut __struct.model_name {
12306 let val = buf.get_u8();
12307 *v = val;
12308 }
12309 for v in &mut __struct.custom_name {
12310 let val = buf.get_u8();
12311 *v = val;
12312 }
12313 __struct.gimbal_device_id = buf.get_u8();
12314 Ok(__struct)
12315 }
12316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12317 let mut __tmp = BytesMut::new(bytes);
12318 #[allow(clippy::absurd_extreme_comparisons)]
12319 #[allow(unused_comparisons)]
12320 if __tmp.remaining() < Self::ENCODED_LEN {
12321 panic!(
12322 "buffer is too small (need {} bytes, but got {})",
12323 Self::ENCODED_LEN,
12324 __tmp.remaining(),
12325 )
12326 }
12327 __tmp.put_u64_le(self.uid);
12328 __tmp.put_u32_le(self.time_boot_ms);
12329 __tmp.put_u32_le(self.firmware_version);
12330 __tmp.put_u32_le(self.hardware_version);
12331 __tmp.put_f32_le(self.roll_min);
12332 __tmp.put_f32_le(self.roll_max);
12333 __tmp.put_f32_le(self.pitch_min);
12334 __tmp.put_f32_le(self.pitch_max);
12335 __tmp.put_f32_le(self.yaw_min);
12336 __tmp.put_f32_le(self.yaw_max);
12337 __tmp.put_u16_le(self.cap_flags.bits());
12338 __tmp.put_u16_le(self.custom_cap_flags);
12339 for val in &self.vendor_name {
12340 __tmp.put_u8(*val);
12341 }
12342 for val in &self.model_name {
12343 __tmp.put_u8(*val);
12344 }
12345 for val in &self.custom_name {
12346 __tmp.put_u8(*val);
12347 }
12348 if matches!(version, MavlinkVersion::V2) {
12349 __tmp.put_u8(self.gimbal_device_id);
12350 let len = __tmp.len();
12351 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12352 } else {
12353 __tmp.len()
12354 }
12355 }
12356}
12357#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12358#[doc = ""]
12359#[doc = "ID: 284"]
12360#[derive(Debug, Clone, PartialEq)]
12361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12363pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12364 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12365 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12366 pub q: [f32; 4],
12367 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12368 pub angular_velocity_x: f32,
12369 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12370 pub angular_velocity_y: f32,
12371 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12372 pub angular_velocity_z: f32,
12373 #[doc = "Low level gimbal flags."]
12374 pub flags: GimbalDeviceFlags,
12375 #[doc = "System ID"]
12376 pub target_system: u8,
12377 #[doc = "Component ID"]
12378 pub target_component: u8,
12379}
12380impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12381 pub const ENCODED_LEN: usize = 32usize;
12382 pub const DEFAULT: Self = Self {
12383 q: [0.0_f32; 4usize],
12384 angular_velocity_x: 0.0_f32,
12385 angular_velocity_y: 0.0_f32,
12386 angular_velocity_z: 0.0_f32,
12387 flags: GimbalDeviceFlags::DEFAULT,
12388 target_system: 0_u8,
12389 target_component: 0_u8,
12390 };
12391 #[cfg(feature = "arbitrary")]
12392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12393 use arbitrary::{Arbitrary, Unstructured};
12394 let mut buf = [0u8; 1024];
12395 rng.fill_bytes(&mut buf);
12396 let mut unstructured = Unstructured::new(&buf);
12397 Self::arbitrary(&mut unstructured).unwrap_or_default()
12398 }
12399}
12400impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12401 fn default() -> Self {
12402 Self::DEFAULT.clone()
12403 }
12404}
12405impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12406 type Message = MavMessage;
12407 const ID: u32 = 284u32;
12408 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12409 const EXTRA_CRC: u8 = 99u8;
12410 const ENCODED_LEN: usize = 32usize;
12411 fn deser(
12412 _version: MavlinkVersion,
12413 __input: &[u8],
12414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12415 let avail_len = __input.len();
12416 let mut payload_buf = [0; Self::ENCODED_LEN];
12417 let mut buf = if avail_len < Self::ENCODED_LEN {
12418 payload_buf[0..avail_len].copy_from_slice(__input);
12419 Bytes::new(&payload_buf)
12420 } else {
12421 Bytes::new(__input)
12422 };
12423 let mut __struct = Self::default();
12424 for v in &mut __struct.q {
12425 let val = buf.get_f32_le();
12426 *v = val;
12427 }
12428 __struct.angular_velocity_x = buf.get_f32_le();
12429 __struct.angular_velocity_y = buf.get_f32_le();
12430 __struct.angular_velocity_z = buf.get_f32_le();
12431 let tmp = buf.get_u16_le();
12432 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12433 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12434 flag_type: "GimbalDeviceFlags",
12435 value: tmp as u32,
12436 })?;
12437 __struct.target_system = buf.get_u8();
12438 __struct.target_component = buf.get_u8();
12439 Ok(__struct)
12440 }
12441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12442 let mut __tmp = BytesMut::new(bytes);
12443 #[allow(clippy::absurd_extreme_comparisons)]
12444 #[allow(unused_comparisons)]
12445 if __tmp.remaining() < Self::ENCODED_LEN {
12446 panic!(
12447 "buffer is too small (need {} bytes, but got {})",
12448 Self::ENCODED_LEN,
12449 __tmp.remaining(),
12450 )
12451 }
12452 for val in &self.q {
12453 __tmp.put_f32_le(*val);
12454 }
12455 __tmp.put_f32_le(self.angular_velocity_x);
12456 __tmp.put_f32_le(self.angular_velocity_y);
12457 __tmp.put_f32_le(self.angular_velocity_z);
12458 __tmp.put_u16_le(self.flags.bits());
12459 __tmp.put_u8(self.target_system);
12460 __tmp.put_u8(self.target_component);
12461 if matches!(version, MavlinkVersion::V2) {
12462 let len = __tmp.len();
12463 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12464 } else {
12465 __tmp.len()
12466 }
12467 }
12468}
12469#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12470#[doc = ""]
12471#[doc = "ID: 280"]
12472#[derive(Debug, Clone, PartialEq)]
12473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12475pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12476 #[doc = "Timestamp (time since system boot)."]
12477 pub time_boot_ms: u32,
12478 #[doc = "Bitmap of gimbal capability flags."]
12479 pub cap_flags: GimbalManagerCapFlags,
12480 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12481 pub roll_min: f32,
12482 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12483 pub roll_max: f32,
12484 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12485 pub pitch_min: f32,
12486 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12487 pub pitch_max: f32,
12488 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12489 pub yaw_min: f32,
12490 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12491 pub yaw_max: f32,
12492 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12493 pub gimbal_device_id: u8,
12494}
12495impl GIMBAL_MANAGER_INFORMATION_DATA {
12496 pub const ENCODED_LEN: usize = 33usize;
12497 pub const DEFAULT: Self = Self {
12498 time_boot_ms: 0_u32,
12499 cap_flags: GimbalManagerCapFlags::DEFAULT,
12500 roll_min: 0.0_f32,
12501 roll_max: 0.0_f32,
12502 pitch_min: 0.0_f32,
12503 pitch_max: 0.0_f32,
12504 yaw_min: 0.0_f32,
12505 yaw_max: 0.0_f32,
12506 gimbal_device_id: 0_u8,
12507 };
12508 #[cfg(feature = "arbitrary")]
12509 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12510 use arbitrary::{Arbitrary, Unstructured};
12511 let mut buf = [0u8; 1024];
12512 rng.fill_bytes(&mut buf);
12513 let mut unstructured = Unstructured::new(&buf);
12514 Self::arbitrary(&mut unstructured).unwrap_or_default()
12515 }
12516}
12517impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12518 fn default() -> Self {
12519 Self::DEFAULT.clone()
12520 }
12521}
12522impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12523 type Message = MavMessage;
12524 const ID: u32 = 280u32;
12525 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12526 const EXTRA_CRC: u8 = 70u8;
12527 const ENCODED_LEN: usize = 33usize;
12528 fn deser(
12529 _version: MavlinkVersion,
12530 __input: &[u8],
12531 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12532 let avail_len = __input.len();
12533 let mut payload_buf = [0; Self::ENCODED_LEN];
12534 let mut buf = if avail_len < Self::ENCODED_LEN {
12535 payload_buf[0..avail_len].copy_from_slice(__input);
12536 Bytes::new(&payload_buf)
12537 } else {
12538 Bytes::new(__input)
12539 };
12540 let mut __struct = Self::default();
12541 __struct.time_boot_ms = buf.get_u32_le();
12542 let tmp = buf.get_u32_le();
12543 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12544 tmp & GimbalManagerCapFlags::all().bits(),
12545 )
12546 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12547 flag_type: "GimbalManagerCapFlags",
12548 value: tmp as u32,
12549 })?;
12550 __struct.roll_min = buf.get_f32_le();
12551 __struct.roll_max = buf.get_f32_le();
12552 __struct.pitch_min = buf.get_f32_le();
12553 __struct.pitch_max = buf.get_f32_le();
12554 __struct.yaw_min = buf.get_f32_le();
12555 __struct.yaw_max = buf.get_f32_le();
12556 __struct.gimbal_device_id = buf.get_u8();
12557 Ok(__struct)
12558 }
12559 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12560 let mut __tmp = BytesMut::new(bytes);
12561 #[allow(clippy::absurd_extreme_comparisons)]
12562 #[allow(unused_comparisons)]
12563 if __tmp.remaining() < Self::ENCODED_LEN {
12564 panic!(
12565 "buffer is too small (need {} bytes, but got {})",
12566 Self::ENCODED_LEN,
12567 __tmp.remaining(),
12568 )
12569 }
12570 __tmp.put_u32_le(self.time_boot_ms);
12571 __tmp.put_u32_le(self.cap_flags.bits());
12572 __tmp.put_f32_le(self.roll_min);
12573 __tmp.put_f32_le(self.roll_max);
12574 __tmp.put_f32_le(self.pitch_min);
12575 __tmp.put_f32_le(self.pitch_max);
12576 __tmp.put_f32_le(self.yaw_min);
12577 __tmp.put_f32_le(self.yaw_max);
12578 __tmp.put_u8(self.gimbal_device_id);
12579 if matches!(version, MavlinkVersion::V2) {
12580 let len = __tmp.len();
12581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12582 } else {
12583 __tmp.len()
12584 }
12585 }
12586}
12587#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12588#[doc = ""]
12589#[doc = "ID: 282"]
12590#[derive(Debug, Clone, PartialEq)]
12591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12592#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12593pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12594 #[doc = "High level gimbal manager flags to use."]
12595 pub flags: GimbalManagerFlags,
12596 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12597 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12598 pub q: [f32; 4],
12599 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12600 pub angular_velocity_x: f32,
12601 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12602 pub angular_velocity_y: f32,
12603 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12604 pub angular_velocity_z: f32,
12605 #[doc = "System ID"]
12606 pub target_system: u8,
12607 #[doc = "Component ID"]
12608 pub target_component: u8,
12609 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12610 pub gimbal_device_id: u8,
12611}
12612impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12613 pub const ENCODED_LEN: usize = 35usize;
12614 pub const DEFAULT: Self = Self {
12615 flags: GimbalManagerFlags::DEFAULT,
12616 q: [0.0_f32; 4usize],
12617 angular_velocity_x: 0.0_f32,
12618 angular_velocity_y: 0.0_f32,
12619 angular_velocity_z: 0.0_f32,
12620 target_system: 0_u8,
12621 target_component: 0_u8,
12622 gimbal_device_id: 0_u8,
12623 };
12624 #[cfg(feature = "arbitrary")]
12625 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12626 use arbitrary::{Arbitrary, Unstructured};
12627 let mut buf = [0u8; 1024];
12628 rng.fill_bytes(&mut buf);
12629 let mut unstructured = Unstructured::new(&buf);
12630 Self::arbitrary(&mut unstructured).unwrap_or_default()
12631 }
12632}
12633impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12634 fn default() -> Self {
12635 Self::DEFAULT.clone()
12636 }
12637}
12638impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12639 type Message = MavMessage;
12640 const ID: u32 = 282u32;
12641 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12642 const EXTRA_CRC: u8 = 123u8;
12643 const ENCODED_LEN: usize = 35usize;
12644 fn deser(
12645 _version: MavlinkVersion,
12646 __input: &[u8],
12647 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12648 let avail_len = __input.len();
12649 let mut payload_buf = [0; Self::ENCODED_LEN];
12650 let mut buf = if avail_len < Self::ENCODED_LEN {
12651 payload_buf[0..avail_len].copy_from_slice(__input);
12652 Bytes::new(&payload_buf)
12653 } else {
12654 Bytes::new(__input)
12655 };
12656 let mut __struct = Self::default();
12657 let tmp = buf.get_u32_le();
12658 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12659 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12660 flag_type: "GimbalManagerFlags",
12661 value: tmp as u32,
12662 })?;
12663 for v in &mut __struct.q {
12664 let val = buf.get_f32_le();
12665 *v = val;
12666 }
12667 __struct.angular_velocity_x = buf.get_f32_le();
12668 __struct.angular_velocity_y = buf.get_f32_le();
12669 __struct.angular_velocity_z = buf.get_f32_le();
12670 __struct.target_system = buf.get_u8();
12671 __struct.target_component = buf.get_u8();
12672 __struct.gimbal_device_id = buf.get_u8();
12673 Ok(__struct)
12674 }
12675 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12676 let mut __tmp = BytesMut::new(bytes);
12677 #[allow(clippy::absurd_extreme_comparisons)]
12678 #[allow(unused_comparisons)]
12679 if __tmp.remaining() < Self::ENCODED_LEN {
12680 panic!(
12681 "buffer is too small (need {} bytes, but got {})",
12682 Self::ENCODED_LEN,
12683 __tmp.remaining(),
12684 )
12685 }
12686 __tmp.put_u32_le(self.flags.bits());
12687 for val in &self.q {
12688 __tmp.put_f32_le(*val);
12689 }
12690 __tmp.put_f32_le(self.angular_velocity_x);
12691 __tmp.put_f32_le(self.angular_velocity_y);
12692 __tmp.put_f32_le(self.angular_velocity_z);
12693 __tmp.put_u8(self.target_system);
12694 __tmp.put_u8(self.target_component);
12695 __tmp.put_u8(self.gimbal_device_id);
12696 if matches!(version, MavlinkVersion::V2) {
12697 let len = __tmp.len();
12698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12699 } else {
12700 __tmp.len()
12701 }
12702 }
12703}
12704#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12705#[doc = ""]
12706#[doc = "ID: 288"]
12707#[derive(Debug, Clone, PartialEq)]
12708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12710pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12711 #[doc = "High level gimbal manager flags."]
12712 pub flags: GimbalManagerFlags,
12713 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12714 pub pitch: f32,
12715 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12716 pub yaw: f32,
12717 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12718 pub pitch_rate: f32,
12719 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12720 pub yaw_rate: f32,
12721 #[doc = "System ID"]
12722 pub target_system: u8,
12723 #[doc = "Component ID"]
12724 pub target_component: u8,
12725 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12726 pub gimbal_device_id: u8,
12727}
12728impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12729 pub const ENCODED_LEN: usize = 23usize;
12730 pub const DEFAULT: Self = Self {
12731 flags: GimbalManagerFlags::DEFAULT,
12732 pitch: 0.0_f32,
12733 yaw: 0.0_f32,
12734 pitch_rate: 0.0_f32,
12735 yaw_rate: 0.0_f32,
12736 target_system: 0_u8,
12737 target_component: 0_u8,
12738 gimbal_device_id: 0_u8,
12739 };
12740 #[cfg(feature = "arbitrary")]
12741 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12742 use arbitrary::{Arbitrary, Unstructured};
12743 let mut buf = [0u8; 1024];
12744 rng.fill_bytes(&mut buf);
12745 let mut unstructured = Unstructured::new(&buf);
12746 Self::arbitrary(&mut unstructured).unwrap_or_default()
12747 }
12748}
12749impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12750 fn default() -> Self {
12751 Self::DEFAULT.clone()
12752 }
12753}
12754impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12755 type Message = MavMessage;
12756 const ID: u32 = 288u32;
12757 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
12758 const EXTRA_CRC: u8 = 20u8;
12759 const ENCODED_LEN: usize = 23usize;
12760 fn deser(
12761 _version: MavlinkVersion,
12762 __input: &[u8],
12763 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12764 let avail_len = __input.len();
12765 let mut payload_buf = [0; Self::ENCODED_LEN];
12766 let mut buf = if avail_len < Self::ENCODED_LEN {
12767 payload_buf[0..avail_len].copy_from_slice(__input);
12768 Bytes::new(&payload_buf)
12769 } else {
12770 Bytes::new(__input)
12771 };
12772 let mut __struct = Self::default();
12773 let tmp = buf.get_u32_le();
12774 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12775 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12776 flag_type: "GimbalManagerFlags",
12777 value: tmp as u32,
12778 })?;
12779 __struct.pitch = buf.get_f32_le();
12780 __struct.yaw = buf.get_f32_le();
12781 __struct.pitch_rate = buf.get_f32_le();
12782 __struct.yaw_rate = buf.get_f32_le();
12783 __struct.target_system = buf.get_u8();
12784 __struct.target_component = buf.get_u8();
12785 __struct.gimbal_device_id = buf.get_u8();
12786 Ok(__struct)
12787 }
12788 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12789 let mut __tmp = BytesMut::new(bytes);
12790 #[allow(clippy::absurd_extreme_comparisons)]
12791 #[allow(unused_comparisons)]
12792 if __tmp.remaining() < Self::ENCODED_LEN {
12793 panic!(
12794 "buffer is too small (need {} bytes, but got {})",
12795 Self::ENCODED_LEN,
12796 __tmp.remaining(),
12797 )
12798 }
12799 __tmp.put_u32_le(self.flags.bits());
12800 __tmp.put_f32_le(self.pitch);
12801 __tmp.put_f32_le(self.yaw);
12802 __tmp.put_f32_le(self.pitch_rate);
12803 __tmp.put_f32_le(self.yaw_rate);
12804 __tmp.put_u8(self.target_system);
12805 __tmp.put_u8(self.target_component);
12806 __tmp.put_u8(self.gimbal_device_id);
12807 if matches!(version, MavlinkVersion::V2) {
12808 let len = __tmp.len();
12809 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12810 } else {
12811 __tmp.len()
12812 }
12813 }
12814}
12815#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
12816#[doc = ""]
12817#[doc = "ID: 287"]
12818#[derive(Debug, Clone, PartialEq)]
12819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12821pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12822 #[doc = "High level gimbal manager flags to use."]
12823 pub flags: GimbalManagerFlags,
12824 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
12825 pub pitch: f32,
12826 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
12827 pub yaw: f32,
12828 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
12829 pub pitch_rate: f32,
12830 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
12831 pub yaw_rate: f32,
12832 #[doc = "System ID"]
12833 pub target_system: u8,
12834 #[doc = "Component ID"]
12835 pub target_component: u8,
12836 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12837 pub gimbal_device_id: u8,
12838}
12839impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12840 pub const ENCODED_LEN: usize = 23usize;
12841 pub const DEFAULT: Self = Self {
12842 flags: GimbalManagerFlags::DEFAULT,
12843 pitch: 0.0_f32,
12844 yaw: 0.0_f32,
12845 pitch_rate: 0.0_f32,
12846 yaw_rate: 0.0_f32,
12847 target_system: 0_u8,
12848 target_component: 0_u8,
12849 gimbal_device_id: 0_u8,
12850 };
12851 #[cfg(feature = "arbitrary")]
12852 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12853 use arbitrary::{Arbitrary, Unstructured};
12854 let mut buf = [0u8; 1024];
12855 rng.fill_bytes(&mut buf);
12856 let mut unstructured = Unstructured::new(&buf);
12857 Self::arbitrary(&mut unstructured).unwrap_or_default()
12858 }
12859}
12860impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12861 fn default() -> Self {
12862 Self::DEFAULT.clone()
12863 }
12864}
12865impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12866 type Message = MavMessage;
12867 const ID: u32 = 287u32;
12868 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
12869 const EXTRA_CRC: u8 = 1u8;
12870 const ENCODED_LEN: usize = 23usize;
12871 fn deser(
12872 _version: MavlinkVersion,
12873 __input: &[u8],
12874 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12875 let avail_len = __input.len();
12876 let mut payload_buf = [0; Self::ENCODED_LEN];
12877 let mut buf = if avail_len < Self::ENCODED_LEN {
12878 payload_buf[0..avail_len].copy_from_slice(__input);
12879 Bytes::new(&payload_buf)
12880 } else {
12881 Bytes::new(__input)
12882 };
12883 let mut __struct = Self::default();
12884 let tmp = buf.get_u32_le();
12885 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12886 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12887 flag_type: "GimbalManagerFlags",
12888 value: tmp as u32,
12889 })?;
12890 __struct.pitch = buf.get_f32_le();
12891 __struct.yaw = buf.get_f32_le();
12892 __struct.pitch_rate = buf.get_f32_le();
12893 __struct.yaw_rate = buf.get_f32_le();
12894 __struct.target_system = buf.get_u8();
12895 __struct.target_component = buf.get_u8();
12896 __struct.gimbal_device_id = buf.get_u8();
12897 Ok(__struct)
12898 }
12899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12900 let mut __tmp = BytesMut::new(bytes);
12901 #[allow(clippy::absurd_extreme_comparisons)]
12902 #[allow(unused_comparisons)]
12903 if __tmp.remaining() < Self::ENCODED_LEN {
12904 panic!(
12905 "buffer is too small (need {} bytes, but got {})",
12906 Self::ENCODED_LEN,
12907 __tmp.remaining(),
12908 )
12909 }
12910 __tmp.put_u32_le(self.flags.bits());
12911 __tmp.put_f32_le(self.pitch);
12912 __tmp.put_f32_le(self.yaw);
12913 __tmp.put_f32_le(self.pitch_rate);
12914 __tmp.put_f32_le(self.yaw_rate);
12915 __tmp.put_u8(self.target_system);
12916 __tmp.put_u8(self.target_component);
12917 __tmp.put_u8(self.gimbal_device_id);
12918 if matches!(version, MavlinkVersion::V2) {
12919 let len = __tmp.len();
12920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12921 } else {
12922 __tmp.len()
12923 }
12924 }
12925}
12926#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
12927#[doc = ""]
12928#[doc = "ID: 281"]
12929#[derive(Debug, Clone, PartialEq)]
12930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12932pub struct GIMBAL_MANAGER_STATUS_DATA {
12933 #[doc = "Timestamp (time since system boot)."]
12934 pub time_boot_ms: u32,
12935 #[doc = "High level gimbal manager flags currently applied."]
12936 pub flags: GimbalManagerFlags,
12937 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12938 pub gimbal_device_id: u8,
12939 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
12940 pub primary_control_sysid: u8,
12941 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
12942 pub primary_control_compid: u8,
12943 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
12944 pub secondary_control_sysid: u8,
12945 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
12946 pub secondary_control_compid: u8,
12947}
12948impl GIMBAL_MANAGER_STATUS_DATA {
12949 pub const ENCODED_LEN: usize = 13usize;
12950 pub const DEFAULT: Self = Self {
12951 time_boot_ms: 0_u32,
12952 flags: GimbalManagerFlags::DEFAULT,
12953 gimbal_device_id: 0_u8,
12954 primary_control_sysid: 0_u8,
12955 primary_control_compid: 0_u8,
12956 secondary_control_sysid: 0_u8,
12957 secondary_control_compid: 0_u8,
12958 };
12959 #[cfg(feature = "arbitrary")]
12960 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12961 use arbitrary::{Arbitrary, Unstructured};
12962 let mut buf = [0u8; 1024];
12963 rng.fill_bytes(&mut buf);
12964 let mut unstructured = Unstructured::new(&buf);
12965 Self::arbitrary(&mut unstructured).unwrap_or_default()
12966 }
12967}
12968impl Default for GIMBAL_MANAGER_STATUS_DATA {
12969 fn default() -> Self {
12970 Self::DEFAULT.clone()
12971 }
12972}
12973impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
12974 type Message = MavMessage;
12975 const ID: u32 = 281u32;
12976 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
12977 const EXTRA_CRC: u8 = 48u8;
12978 const ENCODED_LEN: usize = 13usize;
12979 fn deser(
12980 _version: MavlinkVersion,
12981 __input: &[u8],
12982 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12983 let avail_len = __input.len();
12984 let mut payload_buf = [0; Self::ENCODED_LEN];
12985 let mut buf = if avail_len < Self::ENCODED_LEN {
12986 payload_buf[0..avail_len].copy_from_slice(__input);
12987 Bytes::new(&payload_buf)
12988 } else {
12989 Bytes::new(__input)
12990 };
12991 let mut __struct = Self::default();
12992 __struct.time_boot_ms = buf.get_u32_le();
12993 let tmp = buf.get_u32_le();
12994 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12995 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12996 flag_type: "GimbalManagerFlags",
12997 value: tmp as u32,
12998 })?;
12999 __struct.gimbal_device_id = buf.get_u8();
13000 __struct.primary_control_sysid = buf.get_u8();
13001 __struct.primary_control_compid = buf.get_u8();
13002 __struct.secondary_control_sysid = buf.get_u8();
13003 __struct.secondary_control_compid = buf.get_u8();
13004 Ok(__struct)
13005 }
13006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13007 let mut __tmp = BytesMut::new(bytes);
13008 #[allow(clippy::absurd_extreme_comparisons)]
13009 #[allow(unused_comparisons)]
13010 if __tmp.remaining() < Self::ENCODED_LEN {
13011 panic!(
13012 "buffer is too small (need {} bytes, but got {})",
13013 Self::ENCODED_LEN,
13014 __tmp.remaining(),
13015 )
13016 }
13017 __tmp.put_u32_le(self.time_boot_ms);
13018 __tmp.put_u32_le(self.flags.bits());
13019 __tmp.put_u8(self.gimbal_device_id);
13020 __tmp.put_u8(self.primary_control_sysid);
13021 __tmp.put_u8(self.primary_control_compid);
13022 __tmp.put_u8(self.secondary_control_sysid);
13023 __tmp.put_u8(self.secondary_control_compid);
13024 if matches!(version, MavlinkVersion::V2) {
13025 let len = __tmp.len();
13026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13027 } else {
13028 __tmp.len()
13029 }
13030 }
13031}
13032#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13033#[doc = ""]
13034#[doc = "ID: 33"]
13035#[derive(Debug, Clone, PartialEq)]
13036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13038pub struct GLOBAL_POSITION_INT_DATA {
13039 #[doc = "Timestamp (time since system boot)."]
13040 pub time_boot_ms: u32,
13041 #[doc = "Latitude, expressed"]
13042 pub lat: i32,
13043 #[doc = "Longitude, expressed"]
13044 pub lon: i32,
13045 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13046 pub alt: i32,
13047 #[doc = "Altitude above home"]
13048 pub relative_alt: i32,
13049 #[doc = "Ground X Speed (Latitude, positive north)"]
13050 pub vx: i16,
13051 #[doc = "Ground Y Speed (Longitude, positive east)"]
13052 pub vy: i16,
13053 #[doc = "Ground Z Speed (Altitude, positive down)"]
13054 pub vz: i16,
13055 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13056 pub hdg: u16,
13057}
13058impl GLOBAL_POSITION_INT_DATA {
13059 pub const ENCODED_LEN: usize = 28usize;
13060 pub const DEFAULT: Self = Self {
13061 time_boot_ms: 0_u32,
13062 lat: 0_i32,
13063 lon: 0_i32,
13064 alt: 0_i32,
13065 relative_alt: 0_i32,
13066 vx: 0_i16,
13067 vy: 0_i16,
13068 vz: 0_i16,
13069 hdg: 0_u16,
13070 };
13071 #[cfg(feature = "arbitrary")]
13072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13073 use arbitrary::{Arbitrary, Unstructured};
13074 let mut buf = [0u8; 1024];
13075 rng.fill_bytes(&mut buf);
13076 let mut unstructured = Unstructured::new(&buf);
13077 Self::arbitrary(&mut unstructured).unwrap_or_default()
13078 }
13079}
13080impl Default for GLOBAL_POSITION_INT_DATA {
13081 fn default() -> Self {
13082 Self::DEFAULT.clone()
13083 }
13084}
13085impl MessageData for GLOBAL_POSITION_INT_DATA {
13086 type Message = MavMessage;
13087 const ID: u32 = 33u32;
13088 const NAME: &'static str = "GLOBAL_POSITION_INT";
13089 const EXTRA_CRC: u8 = 104u8;
13090 const ENCODED_LEN: usize = 28usize;
13091 fn deser(
13092 _version: MavlinkVersion,
13093 __input: &[u8],
13094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13095 let avail_len = __input.len();
13096 let mut payload_buf = [0; Self::ENCODED_LEN];
13097 let mut buf = if avail_len < Self::ENCODED_LEN {
13098 payload_buf[0..avail_len].copy_from_slice(__input);
13099 Bytes::new(&payload_buf)
13100 } else {
13101 Bytes::new(__input)
13102 };
13103 let mut __struct = Self::default();
13104 __struct.time_boot_ms = buf.get_u32_le();
13105 __struct.lat = buf.get_i32_le();
13106 __struct.lon = buf.get_i32_le();
13107 __struct.alt = buf.get_i32_le();
13108 __struct.relative_alt = buf.get_i32_le();
13109 __struct.vx = buf.get_i16_le();
13110 __struct.vy = buf.get_i16_le();
13111 __struct.vz = buf.get_i16_le();
13112 __struct.hdg = buf.get_u16_le();
13113 Ok(__struct)
13114 }
13115 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13116 let mut __tmp = BytesMut::new(bytes);
13117 #[allow(clippy::absurd_extreme_comparisons)]
13118 #[allow(unused_comparisons)]
13119 if __tmp.remaining() < Self::ENCODED_LEN {
13120 panic!(
13121 "buffer is too small (need {} bytes, but got {})",
13122 Self::ENCODED_LEN,
13123 __tmp.remaining(),
13124 )
13125 }
13126 __tmp.put_u32_le(self.time_boot_ms);
13127 __tmp.put_i32_le(self.lat);
13128 __tmp.put_i32_le(self.lon);
13129 __tmp.put_i32_le(self.alt);
13130 __tmp.put_i32_le(self.relative_alt);
13131 __tmp.put_i16_le(self.vx);
13132 __tmp.put_i16_le(self.vy);
13133 __tmp.put_i16_le(self.vz);
13134 __tmp.put_u16_le(self.hdg);
13135 if matches!(version, MavlinkVersion::V2) {
13136 let len = __tmp.len();
13137 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13138 } else {
13139 __tmp.len()
13140 }
13141 }
13142}
13143#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13144#[doc = ""]
13145#[doc = "ID: 63"]
13146#[derive(Debug, Clone, PartialEq)]
13147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13149pub struct GLOBAL_POSITION_INT_COV_DATA {
13150 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13151 pub time_usec: u64,
13152 #[doc = "Latitude"]
13153 pub lat: i32,
13154 #[doc = "Longitude"]
13155 pub lon: i32,
13156 #[doc = "Altitude in meters above MSL"]
13157 pub alt: i32,
13158 #[doc = "Altitude above ground"]
13159 pub relative_alt: i32,
13160 #[doc = "Ground X Speed (Latitude)"]
13161 pub vx: f32,
13162 #[doc = "Ground Y Speed (Longitude)"]
13163 pub vy: f32,
13164 #[doc = "Ground Z Speed (Altitude)"]
13165 pub vz: f32,
13166 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13167 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13168 pub covariance: [f32; 36],
13169 #[doc = "Class id of the estimator this estimate originated from."]
13170 pub estimator_type: MavEstimatorType,
13171}
13172impl GLOBAL_POSITION_INT_COV_DATA {
13173 pub const ENCODED_LEN: usize = 181usize;
13174 pub const DEFAULT: Self = Self {
13175 time_usec: 0_u64,
13176 lat: 0_i32,
13177 lon: 0_i32,
13178 alt: 0_i32,
13179 relative_alt: 0_i32,
13180 vx: 0.0_f32,
13181 vy: 0.0_f32,
13182 vz: 0.0_f32,
13183 covariance: [0.0_f32; 36usize],
13184 estimator_type: MavEstimatorType::DEFAULT,
13185 };
13186 #[cfg(feature = "arbitrary")]
13187 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13188 use arbitrary::{Arbitrary, Unstructured};
13189 let mut buf = [0u8; 1024];
13190 rng.fill_bytes(&mut buf);
13191 let mut unstructured = Unstructured::new(&buf);
13192 Self::arbitrary(&mut unstructured).unwrap_or_default()
13193 }
13194}
13195impl Default for GLOBAL_POSITION_INT_COV_DATA {
13196 fn default() -> Self {
13197 Self::DEFAULT.clone()
13198 }
13199}
13200impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13201 type Message = MavMessage;
13202 const ID: u32 = 63u32;
13203 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13204 const EXTRA_CRC: u8 = 119u8;
13205 const ENCODED_LEN: usize = 181usize;
13206 fn deser(
13207 _version: MavlinkVersion,
13208 __input: &[u8],
13209 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13210 let avail_len = __input.len();
13211 let mut payload_buf = [0; Self::ENCODED_LEN];
13212 let mut buf = if avail_len < Self::ENCODED_LEN {
13213 payload_buf[0..avail_len].copy_from_slice(__input);
13214 Bytes::new(&payload_buf)
13215 } else {
13216 Bytes::new(__input)
13217 };
13218 let mut __struct = Self::default();
13219 __struct.time_usec = buf.get_u64_le();
13220 __struct.lat = buf.get_i32_le();
13221 __struct.lon = buf.get_i32_le();
13222 __struct.alt = buf.get_i32_le();
13223 __struct.relative_alt = buf.get_i32_le();
13224 __struct.vx = buf.get_f32_le();
13225 __struct.vy = buf.get_f32_le();
13226 __struct.vz = buf.get_f32_le();
13227 for v in &mut __struct.covariance {
13228 let val = buf.get_f32_le();
13229 *v = val;
13230 }
13231 let tmp = buf.get_u8();
13232 __struct.estimator_type =
13233 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13234 enum_type: "MavEstimatorType",
13235 value: tmp as u32,
13236 })?;
13237 Ok(__struct)
13238 }
13239 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13240 let mut __tmp = BytesMut::new(bytes);
13241 #[allow(clippy::absurd_extreme_comparisons)]
13242 #[allow(unused_comparisons)]
13243 if __tmp.remaining() < Self::ENCODED_LEN {
13244 panic!(
13245 "buffer is too small (need {} bytes, but got {})",
13246 Self::ENCODED_LEN,
13247 __tmp.remaining(),
13248 )
13249 }
13250 __tmp.put_u64_le(self.time_usec);
13251 __tmp.put_i32_le(self.lat);
13252 __tmp.put_i32_le(self.lon);
13253 __tmp.put_i32_le(self.alt);
13254 __tmp.put_i32_le(self.relative_alt);
13255 __tmp.put_f32_le(self.vx);
13256 __tmp.put_f32_le(self.vy);
13257 __tmp.put_f32_le(self.vz);
13258 for val in &self.covariance {
13259 __tmp.put_f32_le(*val);
13260 }
13261 __tmp.put_u8(self.estimator_type as u8);
13262 if matches!(version, MavlinkVersion::V2) {
13263 let len = __tmp.len();
13264 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13265 } else {
13266 __tmp.len()
13267 }
13268 }
13269}
13270#[doc = "Global position/attitude estimate from a vision source."]
13271#[doc = ""]
13272#[doc = "ID: 101"]
13273#[derive(Debug, Clone, PartialEq)]
13274#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13275#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13276pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13277 #[doc = "Timestamp (UNIX time or since system boot)"]
13278 pub usec: u64,
13279 #[doc = "Global X position"]
13280 pub x: f32,
13281 #[doc = "Global Y position"]
13282 pub y: f32,
13283 #[doc = "Global Z position"]
13284 pub z: f32,
13285 #[doc = "Roll angle"]
13286 pub roll: f32,
13287 #[doc = "Pitch angle"]
13288 pub pitch: f32,
13289 #[doc = "Yaw angle"]
13290 pub yaw: f32,
13291 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13292 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13293 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13294 pub covariance: [f32; 21],
13295 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13296 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13297 pub reset_counter: u8,
13298}
13299impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13300 pub const ENCODED_LEN: usize = 117usize;
13301 pub const DEFAULT: Self = Self {
13302 usec: 0_u64,
13303 x: 0.0_f32,
13304 y: 0.0_f32,
13305 z: 0.0_f32,
13306 roll: 0.0_f32,
13307 pitch: 0.0_f32,
13308 yaw: 0.0_f32,
13309 covariance: [0.0_f32; 21usize],
13310 reset_counter: 0_u8,
13311 };
13312 #[cfg(feature = "arbitrary")]
13313 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13314 use arbitrary::{Arbitrary, Unstructured};
13315 let mut buf = [0u8; 1024];
13316 rng.fill_bytes(&mut buf);
13317 let mut unstructured = Unstructured::new(&buf);
13318 Self::arbitrary(&mut unstructured).unwrap_or_default()
13319 }
13320}
13321impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13322 fn default() -> Self {
13323 Self::DEFAULT.clone()
13324 }
13325}
13326impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13327 type Message = MavMessage;
13328 const ID: u32 = 101u32;
13329 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13330 const EXTRA_CRC: u8 = 102u8;
13331 const ENCODED_LEN: usize = 117usize;
13332 fn deser(
13333 _version: MavlinkVersion,
13334 __input: &[u8],
13335 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13336 let avail_len = __input.len();
13337 let mut payload_buf = [0; Self::ENCODED_LEN];
13338 let mut buf = if avail_len < Self::ENCODED_LEN {
13339 payload_buf[0..avail_len].copy_from_slice(__input);
13340 Bytes::new(&payload_buf)
13341 } else {
13342 Bytes::new(__input)
13343 };
13344 let mut __struct = Self::default();
13345 __struct.usec = buf.get_u64_le();
13346 __struct.x = buf.get_f32_le();
13347 __struct.y = buf.get_f32_le();
13348 __struct.z = buf.get_f32_le();
13349 __struct.roll = buf.get_f32_le();
13350 __struct.pitch = buf.get_f32_le();
13351 __struct.yaw = buf.get_f32_le();
13352 for v in &mut __struct.covariance {
13353 let val = buf.get_f32_le();
13354 *v = val;
13355 }
13356 __struct.reset_counter = buf.get_u8();
13357 Ok(__struct)
13358 }
13359 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13360 let mut __tmp = BytesMut::new(bytes);
13361 #[allow(clippy::absurd_extreme_comparisons)]
13362 #[allow(unused_comparisons)]
13363 if __tmp.remaining() < Self::ENCODED_LEN {
13364 panic!(
13365 "buffer is too small (need {} bytes, but got {})",
13366 Self::ENCODED_LEN,
13367 __tmp.remaining(),
13368 )
13369 }
13370 __tmp.put_u64_le(self.usec);
13371 __tmp.put_f32_le(self.x);
13372 __tmp.put_f32_le(self.y);
13373 __tmp.put_f32_le(self.z);
13374 __tmp.put_f32_le(self.roll);
13375 __tmp.put_f32_le(self.pitch);
13376 __tmp.put_f32_le(self.yaw);
13377 if matches!(version, MavlinkVersion::V2) {
13378 for val in &self.covariance {
13379 __tmp.put_f32_le(*val);
13380 }
13381 __tmp.put_u8(self.reset_counter);
13382 let len = __tmp.len();
13383 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13384 } else {
13385 __tmp.len()
13386 }
13387 }
13388}
13389#[doc = "Second GPS data."]
13390#[doc = ""]
13391#[doc = "ID: 124"]
13392#[derive(Debug, Clone, PartialEq)]
13393#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13395pub struct GPS2_RAW_DATA {
13396 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13397 pub time_usec: u64,
13398 #[doc = "Latitude (WGS84)"]
13399 pub lat: i32,
13400 #[doc = "Longitude (WGS84)"]
13401 pub lon: i32,
13402 #[doc = "Altitude (MSL). Positive for up."]
13403 pub alt: i32,
13404 #[doc = "Age of DGPS info"]
13405 pub dgps_age: u32,
13406 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13407 pub eph: u16,
13408 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13409 pub epv: u16,
13410 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13411 pub vel: u16,
13412 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13413 pub cog: u16,
13414 #[doc = "GPS fix type."]
13415 pub fix_type: GpsFixType,
13416 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13417 pub satellites_visible: u8,
13418 #[doc = "Number of DGPS satellites"]
13419 pub dgps_numch: u8,
13420 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13421 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13422 pub yaw: u16,
13423 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13424 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13425 pub alt_ellipsoid: i32,
13426 #[doc = "Position uncertainty."]
13427 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13428 pub h_acc: u32,
13429 #[doc = "Altitude uncertainty."]
13430 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13431 pub v_acc: u32,
13432 #[doc = "Speed uncertainty."]
13433 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13434 pub vel_acc: u32,
13435 #[doc = "Heading / track uncertainty"]
13436 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13437 pub hdg_acc: u32,
13438}
13439impl GPS2_RAW_DATA {
13440 pub const ENCODED_LEN: usize = 57usize;
13441 pub const DEFAULT: Self = Self {
13442 time_usec: 0_u64,
13443 lat: 0_i32,
13444 lon: 0_i32,
13445 alt: 0_i32,
13446 dgps_age: 0_u32,
13447 eph: 0_u16,
13448 epv: 0_u16,
13449 vel: 0_u16,
13450 cog: 0_u16,
13451 fix_type: GpsFixType::DEFAULT,
13452 satellites_visible: 0_u8,
13453 dgps_numch: 0_u8,
13454 yaw: 0_u16,
13455 alt_ellipsoid: 0_i32,
13456 h_acc: 0_u32,
13457 v_acc: 0_u32,
13458 vel_acc: 0_u32,
13459 hdg_acc: 0_u32,
13460 };
13461 #[cfg(feature = "arbitrary")]
13462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13463 use arbitrary::{Arbitrary, Unstructured};
13464 let mut buf = [0u8; 1024];
13465 rng.fill_bytes(&mut buf);
13466 let mut unstructured = Unstructured::new(&buf);
13467 Self::arbitrary(&mut unstructured).unwrap_or_default()
13468 }
13469}
13470impl Default for GPS2_RAW_DATA {
13471 fn default() -> Self {
13472 Self::DEFAULT.clone()
13473 }
13474}
13475impl MessageData for GPS2_RAW_DATA {
13476 type Message = MavMessage;
13477 const ID: u32 = 124u32;
13478 const NAME: &'static str = "GPS2_RAW";
13479 const EXTRA_CRC: u8 = 87u8;
13480 const ENCODED_LEN: usize = 57usize;
13481 fn deser(
13482 _version: MavlinkVersion,
13483 __input: &[u8],
13484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13485 let avail_len = __input.len();
13486 let mut payload_buf = [0; Self::ENCODED_LEN];
13487 let mut buf = if avail_len < Self::ENCODED_LEN {
13488 payload_buf[0..avail_len].copy_from_slice(__input);
13489 Bytes::new(&payload_buf)
13490 } else {
13491 Bytes::new(__input)
13492 };
13493 let mut __struct = Self::default();
13494 __struct.time_usec = buf.get_u64_le();
13495 __struct.lat = buf.get_i32_le();
13496 __struct.lon = buf.get_i32_le();
13497 __struct.alt = buf.get_i32_le();
13498 __struct.dgps_age = buf.get_u32_le();
13499 __struct.eph = buf.get_u16_le();
13500 __struct.epv = buf.get_u16_le();
13501 __struct.vel = buf.get_u16_le();
13502 __struct.cog = buf.get_u16_le();
13503 let tmp = buf.get_u8();
13504 __struct.fix_type =
13505 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13506 enum_type: "GpsFixType",
13507 value: tmp as u32,
13508 })?;
13509 __struct.satellites_visible = buf.get_u8();
13510 __struct.dgps_numch = buf.get_u8();
13511 __struct.yaw = buf.get_u16_le();
13512 __struct.alt_ellipsoid = buf.get_i32_le();
13513 __struct.h_acc = buf.get_u32_le();
13514 __struct.v_acc = buf.get_u32_le();
13515 __struct.vel_acc = buf.get_u32_le();
13516 __struct.hdg_acc = buf.get_u32_le();
13517 Ok(__struct)
13518 }
13519 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13520 let mut __tmp = BytesMut::new(bytes);
13521 #[allow(clippy::absurd_extreme_comparisons)]
13522 #[allow(unused_comparisons)]
13523 if __tmp.remaining() < Self::ENCODED_LEN {
13524 panic!(
13525 "buffer is too small (need {} bytes, but got {})",
13526 Self::ENCODED_LEN,
13527 __tmp.remaining(),
13528 )
13529 }
13530 __tmp.put_u64_le(self.time_usec);
13531 __tmp.put_i32_le(self.lat);
13532 __tmp.put_i32_le(self.lon);
13533 __tmp.put_i32_le(self.alt);
13534 __tmp.put_u32_le(self.dgps_age);
13535 __tmp.put_u16_le(self.eph);
13536 __tmp.put_u16_le(self.epv);
13537 __tmp.put_u16_le(self.vel);
13538 __tmp.put_u16_le(self.cog);
13539 __tmp.put_u8(self.fix_type as u8);
13540 __tmp.put_u8(self.satellites_visible);
13541 __tmp.put_u8(self.dgps_numch);
13542 if matches!(version, MavlinkVersion::V2) {
13543 __tmp.put_u16_le(self.yaw);
13544 __tmp.put_i32_le(self.alt_ellipsoid);
13545 __tmp.put_u32_le(self.h_acc);
13546 __tmp.put_u32_le(self.v_acc);
13547 __tmp.put_u32_le(self.vel_acc);
13548 __tmp.put_u32_le(self.hdg_acc);
13549 let len = __tmp.len();
13550 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13551 } else {
13552 __tmp.len()
13553 }
13554 }
13555}
13556#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13557#[doc = ""]
13558#[doc = "ID: 128"]
13559#[derive(Debug, Clone, PartialEq)]
13560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13561#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13562pub struct GPS2_RTK_DATA {
13563 #[doc = "Time since boot of last baseline message received."]
13564 pub time_last_baseline_ms: u32,
13565 #[doc = "GPS Time of Week of last baseline"]
13566 pub tow: u32,
13567 #[doc = "Current baseline in ECEF x or NED north component."]
13568 pub baseline_a_mm: i32,
13569 #[doc = "Current baseline in ECEF y or NED east component."]
13570 pub baseline_b_mm: i32,
13571 #[doc = "Current baseline in ECEF z or NED down component."]
13572 pub baseline_c_mm: i32,
13573 #[doc = "Current estimate of baseline accuracy."]
13574 pub accuracy: u32,
13575 #[doc = "Current number of integer ambiguity hypotheses."]
13576 pub iar_num_hypotheses: i32,
13577 #[doc = "GPS Week Number of last baseline"]
13578 pub wn: u16,
13579 #[doc = "Identification of connected RTK receiver."]
13580 pub rtk_receiver_id: u8,
13581 #[doc = "GPS-specific health report for RTK data."]
13582 pub rtk_health: u8,
13583 #[doc = "Rate of baseline messages being received by GPS"]
13584 pub rtk_rate: u8,
13585 #[doc = "Current number of sats used for RTK calculation."]
13586 pub nsats: u8,
13587 #[doc = "Coordinate system of baseline"]
13588 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13589}
13590impl GPS2_RTK_DATA {
13591 pub const ENCODED_LEN: usize = 35usize;
13592 pub const DEFAULT: Self = Self {
13593 time_last_baseline_ms: 0_u32,
13594 tow: 0_u32,
13595 baseline_a_mm: 0_i32,
13596 baseline_b_mm: 0_i32,
13597 baseline_c_mm: 0_i32,
13598 accuracy: 0_u32,
13599 iar_num_hypotheses: 0_i32,
13600 wn: 0_u16,
13601 rtk_receiver_id: 0_u8,
13602 rtk_health: 0_u8,
13603 rtk_rate: 0_u8,
13604 nsats: 0_u8,
13605 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13606 };
13607 #[cfg(feature = "arbitrary")]
13608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13609 use arbitrary::{Arbitrary, Unstructured};
13610 let mut buf = [0u8; 1024];
13611 rng.fill_bytes(&mut buf);
13612 let mut unstructured = Unstructured::new(&buf);
13613 Self::arbitrary(&mut unstructured).unwrap_or_default()
13614 }
13615}
13616impl Default for GPS2_RTK_DATA {
13617 fn default() -> Self {
13618 Self::DEFAULT.clone()
13619 }
13620}
13621impl MessageData for GPS2_RTK_DATA {
13622 type Message = MavMessage;
13623 const ID: u32 = 128u32;
13624 const NAME: &'static str = "GPS2_RTK";
13625 const EXTRA_CRC: u8 = 226u8;
13626 const ENCODED_LEN: usize = 35usize;
13627 fn deser(
13628 _version: MavlinkVersion,
13629 __input: &[u8],
13630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13631 let avail_len = __input.len();
13632 let mut payload_buf = [0; Self::ENCODED_LEN];
13633 let mut buf = if avail_len < Self::ENCODED_LEN {
13634 payload_buf[0..avail_len].copy_from_slice(__input);
13635 Bytes::new(&payload_buf)
13636 } else {
13637 Bytes::new(__input)
13638 };
13639 let mut __struct = Self::default();
13640 __struct.time_last_baseline_ms = buf.get_u32_le();
13641 __struct.tow = buf.get_u32_le();
13642 __struct.baseline_a_mm = buf.get_i32_le();
13643 __struct.baseline_b_mm = buf.get_i32_le();
13644 __struct.baseline_c_mm = buf.get_i32_le();
13645 __struct.accuracy = buf.get_u32_le();
13646 __struct.iar_num_hypotheses = buf.get_i32_le();
13647 __struct.wn = buf.get_u16_le();
13648 __struct.rtk_receiver_id = buf.get_u8();
13649 __struct.rtk_health = buf.get_u8();
13650 __struct.rtk_rate = buf.get_u8();
13651 __struct.nsats = buf.get_u8();
13652 let tmp = buf.get_u8();
13653 __struct.baseline_coords_type =
13654 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13655 enum_type: "RtkBaselineCoordinateSystem",
13656 value: tmp as u32,
13657 })?;
13658 Ok(__struct)
13659 }
13660 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13661 let mut __tmp = BytesMut::new(bytes);
13662 #[allow(clippy::absurd_extreme_comparisons)]
13663 #[allow(unused_comparisons)]
13664 if __tmp.remaining() < Self::ENCODED_LEN {
13665 panic!(
13666 "buffer is too small (need {} bytes, but got {})",
13667 Self::ENCODED_LEN,
13668 __tmp.remaining(),
13669 )
13670 }
13671 __tmp.put_u32_le(self.time_last_baseline_ms);
13672 __tmp.put_u32_le(self.tow);
13673 __tmp.put_i32_le(self.baseline_a_mm);
13674 __tmp.put_i32_le(self.baseline_b_mm);
13675 __tmp.put_i32_le(self.baseline_c_mm);
13676 __tmp.put_u32_le(self.accuracy);
13677 __tmp.put_i32_le(self.iar_num_hypotheses);
13678 __tmp.put_u16_le(self.wn);
13679 __tmp.put_u8(self.rtk_receiver_id);
13680 __tmp.put_u8(self.rtk_health);
13681 __tmp.put_u8(self.rtk_rate);
13682 __tmp.put_u8(self.nsats);
13683 __tmp.put_u8(self.baseline_coords_type as u8);
13684 if matches!(version, MavlinkVersion::V2) {
13685 let len = __tmp.len();
13686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13687 } else {
13688 __tmp.len()
13689 }
13690 }
13691}
13692#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13693#[doc = ""]
13694#[doc = "ID: 49"]
13695#[derive(Debug, Clone, PartialEq)]
13696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13698pub struct GPS_GLOBAL_ORIGIN_DATA {
13699 #[doc = "Latitude (WGS84)"]
13700 pub latitude: i32,
13701 #[doc = "Longitude (WGS84)"]
13702 pub longitude: i32,
13703 #[doc = "Altitude (MSL). Positive for up."]
13704 pub altitude: i32,
13705 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13707 pub time_usec: u64,
13708}
13709impl GPS_GLOBAL_ORIGIN_DATA {
13710 pub const ENCODED_LEN: usize = 20usize;
13711 pub const DEFAULT: Self = Self {
13712 latitude: 0_i32,
13713 longitude: 0_i32,
13714 altitude: 0_i32,
13715 time_usec: 0_u64,
13716 };
13717 #[cfg(feature = "arbitrary")]
13718 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13719 use arbitrary::{Arbitrary, Unstructured};
13720 let mut buf = [0u8; 1024];
13721 rng.fill_bytes(&mut buf);
13722 let mut unstructured = Unstructured::new(&buf);
13723 Self::arbitrary(&mut unstructured).unwrap_or_default()
13724 }
13725}
13726impl Default for GPS_GLOBAL_ORIGIN_DATA {
13727 fn default() -> Self {
13728 Self::DEFAULT.clone()
13729 }
13730}
13731impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13732 type Message = MavMessage;
13733 const ID: u32 = 49u32;
13734 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13735 const EXTRA_CRC: u8 = 39u8;
13736 const ENCODED_LEN: usize = 20usize;
13737 fn deser(
13738 _version: MavlinkVersion,
13739 __input: &[u8],
13740 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13741 let avail_len = __input.len();
13742 let mut payload_buf = [0; Self::ENCODED_LEN];
13743 let mut buf = if avail_len < Self::ENCODED_LEN {
13744 payload_buf[0..avail_len].copy_from_slice(__input);
13745 Bytes::new(&payload_buf)
13746 } else {
13747 Bytes::new(__input)
13748 };
13749 let mut __struct = Self::default();
13750 __struct.latitude = buf.get_i32_le();
13751 __struct.longitude = buf.get_i32_le();
13752 __struct.altitude = buf.get_i32_le();
13753 __struct.time_usec = buf.get_u64_le();
13754 Ok(__struct)
13755 }
13756 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13757 let mut __tmp = BytesMut::new(bytes);
13758 #[allow(clippy::absurd_extreme_comparisons)]
13759 #[allow(unused_comparisons)]
13760 if __tmp.remaining() < Self::ENCODED_LEN {
13761 panic!(
13762 "buffer is too small (need {} bytes, but got {})",
13763 Self::ENCODED_LEN,
13764 __tmp.remaining(),
13765 )
13766 }
13767 __tmp.put_i32_le(self.latitude);
13768 __tmp.put_i32_le(self.longitude);
13769 __tmp.put_i32_le(self.altitude);
13770 if matches!(version, MavlinkVersion::V2) {
13771 __tmp.put_u64_le(self.time_usec);
13772 let len = __tmp.len();
13773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13774 } else {
13775 __tmp.len()
13776 }
13777 }
13778}
13779#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
13780#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
13781#[doc = ""]
13782#[doc = "ID: 123"]
13783#[derive(Debug, Clone, PartialEq)]
13784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13786pub struct GPS_INJECT_DATA_DATA {
13787 #[doc = "System ID"]
13788 pub target_system: u8,
13789 #[doc = "Component ID"]
13790 pub target_component: u8,
13791 #[doc = "Data length"]
13792 pub len: u8,
13793 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
13794 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13795 pub data: [u8; 110],
13796}
13797impl GPS_INJECT_DATA_DATA {
13798 pub const ENCODED_LEN: usize = 113usize;
13799 pub const DEFAULT: Self = Self {
13800 target_system: 0_u8,
13801 target_component: 0_u8,
13802 len: 0_u8,
13803 data: [0_u8; 110usize],
13804 };
13805 #[cfg(feature = "arbitrary")]
13806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13807 use arbitrary::{Arbitrary, Unstructured};
13808 let mut buf = [0u8; 1024];
13809 rng.fill_bytes(&mut buf);
13810 let mut unstructured = Unstructured::new(&buf);
13811 Self::arbitrary(&mut unstructured).unwrap_or_default()
13812 }
13813}
13814impl Default for GPS_INJECT_DATA_DATA {
13815 fn default() -> Self {
13816 Self::DEFAULT.clone()
13817 }
13818}
13819impl MessageData for GPS_INJECT_DATA_DATA {
13820 type Message = MavMessage;
13821 const ID: u32 = 123u32;
13822 const NAME: &'static str = "GPS_INJECT_DATA";
13823 const EXTRA_CRC: u8 = 250u8;
13824 const ENCODED_LEN: usize = 113usize;
13825 fn deser(
13826 _version: MavlinkVersion,
13827 __input: &[u8],
13828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13829 let avail_len = __input.len();
13830 let mut payload_buf = [0; Self::ENCODED_LEN];
13831 let mut buf = if avail_len < Self::ENCODED_LEN {
13832 payload_buf[0..avail_len].copy_from_slice(__input);
13833 Bytes::new(&payload_buf)
13834 } else {
13835 Bytes::new(__input)
13836 };
13837 let mut __struct = Self::default();
13838 __struct.target_system = buf.get_u8();
13839 __struct.target_component = buf.get_u8();
13840 __struct.len = buf.get_u8();
13841 for v in &mut __struct.data {
13842 let val = buf.get_u8();
13843 *v = val;
13844 }
13845 Ok(__struct)
13846 }
13847 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13848 let mut __tmp = BytesMut::new(bytes);
13849 #[allow(clippy::absurd_extreme_comparisons)]
13850 #[allow(unused_comparisons)]
13851 if __tmp.remaining() < Self::ENCODED_LEN {
13852 panic!(
13853 "buffer is too small (need {} bytes, but got {})",
13854 Self::ENCODED_LEN,
13855 __tmp.remaining(),
13856 )
13857 }
13858 __tmp.put_u8(self.target_system);
13859 __tmp.put_u8(self.target_component);
13860 __tmp.put_u8(self.len);
13861 for val in &self.data {
13862 __tmp.put_u8(*val);
13863 }
13864 if matches!(version, MavlinkVersion::V2) {
13865 let len = __tmp.len();
13866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13867 } else {
13868 __tmp.len()
13869 }
13870 }
13871}
13872#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
13873#[doc = ""]
13874#[doc = "ID: 232"]
13875#[derive(Debug, Clone, PartialEq)]
13876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13878pub struct GPS_INPUT_DATA {
13879 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13880 pub time_usec: u64,
13881 #[doc = "GPS time (from start of GPS week)"]
13882 pub time_week_ms: u32,
13883 #[doc = "Latitude (WGS84)"]
13884 pub lat: i32,
13885 #[doc = "Longitude (WGS84)"]
13886 pub lon: i32,
13887 #[doc = "Altitude (MSL). Positive for up."]
13888 pub alt: f32,
13889 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13890 pub hdop: f32,
13891 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13892 pub vdop: f32,
13893 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
13894 pub vn: f32,
13895 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
13896 pub ve: f32,
13897 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
13898 pub vd: f32,
13899 #[doc = "GPS speed accuracy"]
13900 pub speed_accuracy: f32,
13901 #[doc = "GPS horizontal accuracy"]
13902 pub horiz_accuracy: f32,
13903 #[doc = "GPS vertical accuracy"]
13904 pub vert_accuracy: f32,
13905 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
13906 pub ignore_flags: GpsInputIgnoreFlags,
13907 #[doc = "GPS week number"]
13908 pub time_week: u16,
13909 #[doc = "ID of the GPS for multiple GPS inputs"]
13910 pub gps_id: u8,
13911 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
13912 pub fix_type: u8,
13913 #[doc = "Number of satellites visible."]
13914 pub satellites_visible: u8,
13915 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
13916 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13917 pub yaw: u16,
13918}
13919impl GPS_INPUT_DATA {
13920 pub const ENCODED_LEN: usize = 65usize;
13921 pub const DEFAULT: Self = Self {
13922 time_usec: 0_u64,
13923 time_week_ms: 0_u32,
13924 lat: 0_i32,
13925 lon: 0_i32,
13926 alt: 0.0_f32,
13927 hdop: 0.0_f32,
13928 vdop: 0.0_f32,
13929 vn: 0.0_f32,
13930 ve: 0.0_f32,
13931 vd: 0.0_f32,
13932 speed_accuracy: 0.0_f32,
13933 horiz_accuracy: 0.0_f32,
13934 vert_accuracy: 0.0_f32,
13935 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
13936 time_week: 0_u16,
13937 gps_id: 0_u8,
13938 fix_type: 0_u8,
13939 satellites_visible: 0_u8,
13940 yaw: 0_u16,
13941 };
13942 #[cfg(feature = "arbitrary")]
13943 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13944 use arbitrary::{Arbitrary, Unstructured};
13945 let mut buf = [0u8; 1024];
13946 rng.fill_bytes(&mut buf);
13947 let mut unstructured = Unstructured::new(&buf);
13948 Self::arbitrary(&mut unstructured).unwrap_or_default()
13949 }
13950}
13951impl Default for GPS_INPUT_DATA {
13952 fn default() -> Self {
13953 Self::DEFAULT.clone()
13954 }
13955}
13956impl MessageData for GPS_INPUT_DATA {
13957 type Message = MavMessage;
13958 const ID: u32 = 232u32;
13959 const NAME: &'static str = "GPS_INPUT";
13960 const EXTRA_CRC: u8 = 151u8;
13961 const ENCODED_LEN: usize = 65usize;
13962 fn deser(
13963 _version: MavlinkVersion,
13964 __input: &[u8],
13965 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13966 let avail_len = __input.len();
13967 let mut payload_buf = [0; Self::ENCODED_LEN];
13968 let mut buf = if avail_len < Self::ENCODED_LEN {
13969 payload_buf[0..avail_len].copy_from_slice(__input);
13970 Bytes::new(&payload_buf)
13971 } else {
13972 Bytes::new(__input)
13973 };
13974 let mut __struct = Self::default();
13975 __struct.time_usec = buf.get_u64_le();
13976 __struct.time_week_ms = buf.get_u32_le();
13977 __struct.lat = buf.get_i32_le();
13978 __struct.lon = buf.get_i32_le();
13979 __struct.alt = buf.get_f32_le();
13980 __struct.hdop = buf.get_f32_le();
13981 __struct.vdop = buf.get_f32_le();
13982 __struct.vn = buf.get_f32_le();
13983 __struct.ve = buf.get_f32_le();
13984 __struct.vd = buf.get_f32_le();
13985 __struct.speed_accuracy = buf.get_f32_le();
13986 __struct.horiz_accuracy = buf.get_f32_le();
13987 __struct.vert_accuracy = buf.get_f32_le();
13988 let tmp = buf.get_u16_le();
13989 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
13990 tmp & GpsInputIgnoreFlags::all().bits(),
13991 )
13992 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13993 flag_type: "GpsInputIgnoreFlags",
13994 value: tmp as u32,
13995 })?;
13996 __struct.time_week = buf.get_u16_le();
13997 __struct.gps_id = buf.get_u8();
13998 __struct.fix_type = buf.get_u8();
13999 __struct.satellites_visible = buf.get_u8();
14000 __struct.yaw = buf.get_u16_le();
14001 Ok(__struct)
14002 }
14003 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14004 let mut __tmp = BytesMut::new(bytes);
14005 #[allow(clippy::absurd_extreme_comparisons)]
14006 #[allow(unused_comparisons)]
14007 if __tmp.remaining() < Self::ENCODED_LEN {
14008 panic!(
14009 "buffer is too small (need {} bytes, but got {})",
14010 Self::ENCODED_LEN,
14011 __tmp.remaining(),
14012 )
14013 }
14014 __tmp.put_u64_le(self.time_usec);
14015 __tmp.put_u32_le(self.time_week_ms);
14016 __tmp.put_i32_le(self.lat);
14017 __tmp.put_i32_le(self.lon);
14018 __tmp.put_f32_le(self.alt);
14019 __tmp.put_f32_le(self.hdop);
14020 __tmp.put_f32_le(self.vdop);
14021 __tmp.put_f32_le(self.vn);
14022 __tmp.put_f32_le(self.ve);
14023 __tmp.put_f32_le(self.vd);
14024 __tmp.put_f32_le(self.speed_accuracy);
14025 __tmp.put_f32_le(self.horiz_accuracy);
14026 __tmp.put_f32_le(self.vert_accuracy);
14027 __tmp.put_u16_le(self.ignore_flags.bits());
14028 __tmp.put_u16_le(self.time_week);
14029 __tmp.put_u8(self.gps_id);
14030 __tmp.put_u8(self.fix_type);
14031 __tmp.put_u8(self.satellites_visible);
14032 if matches!(version, MavlinkVersion::V2) {
14033 __tmp.put_u16_le(self.yaw);
14034 let len = __tmp.len();
14035 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14036 } else {
14037 __tmp.len()
14038 }
14039 }
14040}
14041#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14042#[doc = ""]
14043#[doc = "ID: 24"]
14044#[derive(Debug, Clone, PartialEq)]
14045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14047pub struct GPS_RAW_INT_DATA {
14048 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14049 pub time_usec: u64,
14050 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14051 pub lat: i32,
14052 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14053 pub lon: i32,
14054 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14055 pub alt: i32,
14056 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14057 pub eph: u16,
14058 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14059 pub epv: u16,
14060 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14061 pub vel: u16,
14062 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14063 pub cog: u16,
14064 #[doc = "GPS fix type."]
14065 pub fix_type: GpsFixType,
14066 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14067 pub satellites_visible: u8,
14068 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14069 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14070 pub alt_ellipsoid: i32,
14071 #[doc = "Position uncertainty."]
14072 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14073 pub h_acc: u32,
14074 #[doc = "Altitude uncertainty."]
14075 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14076 pub v_acc: u32,
14077 #[doc = "Speed uncertainty."]
14078 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14079 pub vel_acc: u32,
14080 #[doc = "Heading / track uncertainty"]
14081 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14082 pub hdg_acc: u32,
14083 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14084 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14085 pub yaw: u16,
14086}
14087impl GPS_RAW_INT_DATA {
14088 pub const ENCODED_LEN: usize = 52usize;
14089 pub const DEFAULT: Self = Self {
14090 time_usec: 0_u64,
14091 lat: 0_i32,
14092 lon: 0_i32,
14093 alt: 0_i32,
14094 eph: 0_u16,
14095 epv: 0_u16,
14096 vel: 0_u16,
14097 cog: 0_u16,
14098 fix_type: GpsFixType::DEFAULT,
14099 satellites_visible: 0_u8,
14100 alt_ellipsoid: 0_i32,
14101 h_acc: 0_u32,
14102 v_acc: 0_u32,
14103 vel_acc: 0_u32,
14104 hdg_acc: 0_u32,
14105 yaw: 0_u16,
14106 };
14107 #[cfg(feature = "arbitrary")]
14108 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14109 use arbitrary::{Arbitrary, Unstructured};
14110 let mut buf = [0u8; 1024];
14111 rng.fill_bytes(&mut buf);
14112 let mut unstructured = Unstructured::new(&buf);
14113 Self::arbitrary(&mut unstructured).unwrap_or_default()
14114 }
14115}
14116impl Default for GPS_RAW_INT_DATA {
14117 fn default() -> Self {
14118 Self::DEFAULT.clone()
14119 }
14120}
14121impl MessageData for GPS_RAW_INT_DATA {
14122 type Message = MavMessage;
14123 const ID: u32 = 24u32;
14124 const NAME: &'static str = "GPS_RAW_INT";
14125 const EXTRA_CRC: u8 = 24u8;
14126 const ENCODED_LEN: usize = 52usize;
14127 fn deser(
14128 _version: MavlinkVersion,
14129 __input: &[u8],
14130 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14131 let avail_len = __input.len();
14132 let mut payload_buf = [0; Self::ENCODED_LEN];
14133 let mut buf = if avail_len < Self::ENCODED_LEN {
14134 payload_buf[0..avail_len].copy_from_slice(__input);
14135 Bytes::new(&payload_buf)
14136 } else {
14137 Bytes::new(__input)
14138 };
14139 let mut __struct = Self::default();
14140 __struct.time_usec = buf.get_u64_le();
14141 __struct.lat = buf.get_i32_le();
14142 __struct.lon = buf.get_i32_le();
14143 __struct.alt = buf.get_i32_le();
14144 __struct.eph = buf.get_u16_le();
14145 __struct.epv = buf.get_u16_le();
14146 __struct.vel = buf.get_u16_le();
14147 __struct.cog = buf.get_u16_le();
14148 let tmp = buf.get_u8();
14149 __struct.fix_type =
14150 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14151 enum_type: "GpsFixType",
14152 value: tmp as u32,
14153 })?;
14154 __struct.satellites_visible = buf.get_u8();
14155 __struct.alt_ellipsoid = buf.get_i32_le();
14156 __struct.h_acc = buf.get_u32_le();
14157 __struct.v_acc = buf.get_u32_le();
14158 __struct.vel_acc = buf.get_u32_le();
14159 __struct.hdg_acc = buf.get_u32_le();
14160 __struct.yaw = buf.get_u16_le();
14161 Ok(__struct)
14162 }
14163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14164 let mut __tmp = BytesMut::new(bytes);
14165 #[allow(clippy::absurd_extreme_comparisons)]
14166 #[allow(unused_comparisons)]
14167 if __tmp.remaining() < Self::ENCODED_LEN {
14168 panic!(
14169 "buffer is too small (need {} bytes, but got {})",
14170 Self::ENCODED_LEN,
14171 __tmp.remaining(),
14172 )
14173 }
14174 __tmp.put_u64_le(self.time_usec);
14175 __tmp.put_i32_le(self.lat);
14176 __tmp.put_i32_le(self.lon);
14177 __tmp.put_i32_le(self.alt);
14178 __tmp.put_u16_le(self.eph);
14179 __tmp.put_u16_le(self.epv);
14180 __tmp.put_u16_le(self.vel);
14181 __tmp.put_u16_le(self.cog);
14182 __tmp.put_u8(self.fix_type as u8);
14183 __tmp.put_u8(self.satellites_visible);
14184 if matches!(version, MavlinkVersion::V2) {
14185 __tmp.put_i32_le(self.alt_ellipsoid);
14186 __tmp.put_u32_le(self.h_acc);
14187 __tmp.put_u32_le(self.v_acc);
14188 __tmp.put_u32_le(self.vel_acc);
14189 __tmp.put_u32_le(self.hdg_acc);
14190 __tmp.put_u16_le(self.yaw);
14191 let len = __tmp.len();
14192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14193 } else {
14194 __tmp.len()
14195 }
14196 }
14197}
14198#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14199#[doc = ""]
14200#[doc = "ID: 233"]
14201#[derive(Debug, Clone, PartialEq)]
14202#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14204pub struct GPS_RTCM_DATA_DATA {
14205 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14206 pub flags: u8,
14207 #[doc = "data length"]
14208 pub len: u8,
14209 #[doc = "RTCM message (may be fragmented)"]
14210 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14211 pub data: [u8; 180],
14212}
14213impl GPS_RTCM_DATA_DATA {
14214 pub const ENCODED_LEN: usize = 182usize;
14215 pub const DEFAULT: Self = Self {
14216 flags: 0_u8,
14217 len: 0_u8,
14218 data: [0_u8; 180usize],
14219 };
14220 #[cfg(feature = "arbitrary")]
14221 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14222 use arbitrary::{Arbitrary, Unstructured};
14223 let mut buf = [0u8; 1024];
14224 rng.fill_bytes(&mut buf);
14225 let mut unstructured = Unstructured::new(&buf);
14226 Self::arbitrary(&mut unstructured).unwrap_or_default()
14227 }
14228}
14229impl Default for GPS_RTCM_DATA_DATA {
14230 fn default() -> Self {
14231 Self::DEFAULT.clone()
14232 }
14233}
14234impl MessageData for GPS_RTCM_DATA_DATA {
14235 type Message = MavMessage;
14236 const ID: u32 = 233u32;
14237 const NAME: &'static str = "GPS_RTCM_DATA";
14238 const EXTRA_CRC: u8 = 35u8;
14239 const ENCODED_LEN: usize = 182usize;
14240 fn deser(
14241 _version: MavlinkVersion,
14242 __input: &[u8],
14243 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14244 let avail_len = __input.len();
14245 let mut payload_buf = [0; Self::ENCODED_LEN];
14246 let mut buf = if avail_len < Self::ENCODED_LEN {
14247 payload_buf[0..avail_len].copy_from_slice(__input);
14248 Bytes::new(&payload_buf)
14249 } else {
14250 Bytes::new(__input)
14251 };
14252 let mut __struct = Self::default();
14253 __struct.flags = buf.get_u8();
14254 __struct.len = buf.get_u8();
14255 for v in &mut __struct.data {
14256 let val = buf.get_u8();
14257 *v = val;
14258 }
14259 Ok(__struct)
14260 }
14261 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14262 let mut __tmp = BytesMut::new(bytes);
14263 #[allow(clippy::absurd_extreme_comparisons)]
14264 #[allow(unused_comparisons)]
14265 if __tmp.remaining() < Self::ENCODED_LEN {
14266 panic!(
14267 "buffer is too small (need {} bytes, but got {})",
14268 Self::ENCODED_LEN,
14269 __tmp.remaining(),
14270 )
14271 }
14272 __tmp.put_u8(self.flags);
14273 __tmp.put_u8(self.len);
14274 for val in &self.data {
14275 __tmp.put_u8(*val);
14276 }
14277 if matches!(version, MavlinkVersion::V2) {
14278 let len = __tmp.len();
14279 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14280 } else {
14281 __tmp.len()
14282 }
14283 }
14284}
14285#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14286#[doc = ""]
14287#[doc = "ID: 127"]
14288#[derive(Debug, Clone, PartialEq)]
14289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14290#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14291pub struct GPS_RTK_DATA {
14292 #[doc = "Time since boot of last baseline message received."]
14293 pub time_last_baseline_ms: u32,
14294 #[doc = "GPS Time of Week of last baseline"]
14295 pub tow: u32,
14296 #[doc = "Current baseline in ECEF x or NED north component."]
14297 pub baseline_a_mm: i32,
14298 #[doc = "Current baseline in ECEF y or NED east component."]
14299 pub baseline_b_mm: i32,
14300 #[doc = "Current baseline in ECEF z or NED down component."]
14301 pub baseline_c_mm: i32,
14302 #[doc = "Current estimate of baseline accuracy."]
14303 pub accuracy: u32,
14304 #[doc = "Current number of integer ambiguity hypotheses."]
14305 pub iar_num_hypotheses: i32,
14306 #[doc = "GPS Week Number of last baseline"]
14307 pub wn: u16,
14308 #[doc = "Identification of connected RTK receiver."]
14309 pub rtk_receiver_id: u8,
14310 #[doc = "GPS-specific health report for RTK data."]
14311 pub rtk_health: u8,
14312 #[doc = "Rate of baseline messages being received by GPS"]
14313 pub rtk_rate: u8,
14314 #[doc = "Current number of sats used for RTK calculation."]
14315 pub nsats: u8,
14316 #[doc = "Coordinate system of baseline"]
14317 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14318}
14319impl GPS_RTK_DATA {
14320 pub const ENCODED_LEN: usize = 35usize;
14321 pub const DEFAULT: Self = Self {
14322 time_last_baseline_ms: 0_u32,
14323 tow: 0_u32,
14324 baseline_a_mm: 0_i32,
14325 baseline_b_mm: 0_i32,
14326 baseline_c_mm: 0_i32,
14327 accuracy: 0_u32,
14328 iar_num_hypotheses: 0_i32,
14329 wn: 0_u16,
14330 rtk_receiver_id: 0_u8,
14331 rtk_health: 0_u8,
14332 rtk_rate: 0_u8,
14333 nsats: 0_u8,
14334 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14335 };
14336 #[cfg(feature = "arbitrary")]
14337 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14338 use arbitrary::{Arbitrary, Unstructured};
14339 let mut buf = [0u8; 1024];
14340 rng.fill_bytes(&mut buf);
14341 let mut unstructured = Unstructured::new(&buf);
14342 Self::arbitrary(&mut unstructured).unwrap_or_default()
14343 }
14344}
14345impl Default for GPS_RTK_DATA {
14346 fn default() -> Self {
14347 Self::DEFAULT.clone()
14348 }
14349}
14350impl MessageData for GPS_RTK_DATA {
14351 type Message = MavMessage;
14352 const ID: u32 = 127u32;
14353 const NAME: &'static str = "GPS_RTK";
14354 const EXTRA_CRC: u8 = 25u8;
14355 const ENCODED_LEN: usize = 35usize;
14356 fn deser(
14357 _version: MavlinkVersion,
14358 __input: &[u8],
14359 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14360 let avail_len = __input.len();
14361 let mut payload_buf = [0; Self::ENCODED_LEN];
14362 let mut buf = if avail_len < Self::ENCODED_LEN {
14363 payload_buf[0..avail_len].copy_from_slice(__input);
14364 Bytes::new(&payload_buf)
14365 } else {
14366 Bytes::new(__input)
14367 };
14368 let mut __struct = Self::default();
14369 __struct.time_last_baseline_ms = buf.get_u32_le();
14370 __struct.tow = buf.get_u32_le();
14371 __struct.baseline_a_mm = buf.get_i32_le();
14372 __struct.baseline_b_mm = buf.get_i32_le();
14373 __struct.baseline_c_mm = buf.get_i32_le();
14374 __struct.accuracy = buf.get_u32_le();
14375 __struct.iar_num_hypotheses = buf.get_i32_le();
14376 __struct.wn = buf.get_u16_le();
14377 __struct.rtk_receiver_id = buf.get_u8();
14378 __struct.rtk_health = buf.get_u8();
14379 __struct.rtk_rate = buf.get_u8();
14380 __struct.nsats = buf.get_u8();
14381 let tmp = buf.get_u8();
14382 __struct.baseline_coords_type =
14383 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14384 enum_type: "RtkBaselineCoordinateSystem",
14385 value: tmp as u32,
14386 })?;
14387 Ok(__struct)
14388 }
14389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14390 let mut __tmp = BytesMut::new(bytes);
14391 #[allow(clippy::absurd_extreme_comparisons)]
14392 #[allow(unused_comparisons)]
14393 if __tmp.remaining() < Self::ENCODED_LEN {
14394 panic!(
14395 "buffer is too small (need {} bytes, but got {})",
14396 Self::ENCODED_LEN,
14397 __tmp.remaining(),
14398 )
14399 }
14400 __tmp.put_u32_le(self.time_last_baseline_ms);
14401 __tmp.put_u32_le(self.tow);
14402 __tmp.put_i32_le(self.baseline_a_mm);
14403 __tmp.put_i32_le(self.baseline_b_mm);
14404 __tmp.put_i32_le(self.baseline_c_mm);
14405 __tmp.put_u32_le(self.accuracy);
14406 __tmp.put_i32_le(self.iar_num_hypotheses);
14407 __tmp.put_u16_le(self.wn);
14408 __tmp.put_u8(self.rtk_receiver_id);
14409 __tmp.put_u8(self.rtk_health);
14410 __tmp.put_u8(self.rtk_rate);
14411 __tmp.put_u8(self.nsats);
14412 __tmp.put_u8(self.baseline_coords_type as u8);
14413 if matches!(version, MavlinkVersion::V2) {
14414 let len = __tmp.len();
14415 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14416 } else {
14417 __tmp.len()
14418 }
14419 }
14420}
14421#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14422#[doc = ""]
14423#[doc = "ID: 25"]
14424#[derive(Debug, Clone, PartialEq)]
14425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14426#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14427pub struct GPS_STATUS_DATA {
14428 #[doc = "Number of satellites visible"]
14429 pub satellites_visible: u8,
14430 #[doc = "Global satellite ID"]
14431 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14432 pub satellite_prn: [u8; 20],
14433 #[doc = "0: Satellite not used, 1: used for localization"]
14434 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14435 pub satellite_used: [u8; 20],
14436 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14437 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14438 pub satellite_elevation: [u8; 20],
14439 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14440 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14441 pub satellite_azimuth: [u8; 20],
14442 #[doc = "Signal to noise ratio of satellite"]
14443 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14444 pub satellite_snr: [u8; 20],
14445}
14446impl GPS_STATUS_DATA {
14447 pub const ENCODED_LEN: usize = 101usize;
14448 pub const DEFAULT: Self = Self {
14449 satellites_visible: 0_u8,
14450 satellite_prn: [0_u8; 20usize],
14451 satellite_used: [0_u8; 20usize],
14452 satellite_elevation: [0_u8; 20usize],
14453 satellite_azimuth: [0_u8; 20usize],
14454 satellite_snr: [0_u8; 20usize],
14455 };
14456 #[cfg(feature = "arbitrary")]
14457 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14458 use arbitrary::{Arbitrary, Unstructured};
14459 let mut buf = [0u8; 1024];
14460 rng.fill_bytes(&mut buf);
14461 let mut unstructured = Unstructured::new(&buf);
14462 Self::arbitrary(&mut unstructured).unwrap_or_default()
14463 }
14464}
14465impl Default for GPS_STATUS_DATA {
14466 fn default() -> Self {
14467 Self::DEFAULT.clone()
14468 }
14469}
14470impl MessageData for GPS_STATUS_DATA {
14471 type Message = MavMessage;
14472 const ID: u32 = 25u32;
14473 const NAME: &'static str = "GPS_STATUS";
14474 const EXTRA_CRC: u8 = 23u8;
14475 const ENCODED_LEN: usize = 101usize;
14476 fn deser(
14477 _version: MavlinkVersion,
14478 __input: &[u8],
14479 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14480 let avail_len = __input.len();
14481 let mut payload_buf = [0; Self::ENCODED_LEN];
14482 let mut buf = if avail_len < Self::ENCODED_LEN {
14483 payload_buf[0..avail_len].copy_from_slice(__input);
14484 Bytes::new(&payload_buf)
14485 } else {
14486 Bytes::new(__input)
14487 };
14488 let mut __struct = Self::default();
14489 __struct.satellites_visible = buf.get_u8();
14490 for v in &mut __struct.satellite_prn {
14491 let val = buf.get_u8();
14492 *v = val;
14493 }
14494 for v in &mut __struct.satellite_used {
14495 let val = buf.get_u8();
14496 *v = val;
14497 }
14498 for v in &mut __struct.satellite_elevation {
14499 let val = buf.get_u8();
14500 *v = val;
14501 }
14502 for v in &mut __struct.satellite_azimuth {
14503 let val = buf.get_u8();
14504 *v = val;
14505 }
14506 for v in &mut __struct.satellite_snr {
14507 let val = buf.get_u8();
14508 *v = val;
14509 }
14510 Ok(__struct)
14511 }
14512 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14513 let mut __tmp = BytesMut::new(bytes);
14514 #[allow(clippy::absurd_extreme_comparisons)]
14515 #[allow(unused_comparisons)]
14516 if __tmp.remaining() < Self::ENCODED_LEN {
14517 panic!(
14518 "buffer is too small (need {} bytes, but got {})",
14519 Self::ENCODED_LEN,
14520 __tmp.remaining(),
14521 )
14522 }
14523 __tmp.put_u8(self.satellites_visible);
14524 for val in &self.satellite_prn {
14525 __tmp.put_u8(*val);
14526 }
14527 for val in &self.satellite_used {
14528 __tmp.put_u8(*val);
14529 }
14530 for val in &self.satellite_elevation {
14531 __tmp.put_u8(*val);
14532 }
14533 for val in &self.satellite_azimuth {
14534 __tmp.put_u8(*val);
14535 }
14536 for val in &self.satellite_snr {
14537 __tmp.put_u8(*val);
14538 }
14539 if matches!(version, MavlinkVersion::V2) {
14540 let len = __tmp.len();
14541 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14542 } else {
14543 __tmp.len()
14544 }
14545 }
14546}
14547#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14548#[doc = ""]
14549#[doc = "ID: 0"]
14550#[derive(Debug, Clone, PartialEq)]
14551#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14553pub struct HEARTBEAT_DATA {
14554 #[doc = "A bitfield for use for autopilot-specific flags"]
14555 pub custom_mode: u32,
14556 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14557 pub mavtype: MavType,
14558 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14559 pub autopilot: MavAutopilot,
14560 #[doc = "System mode bitmap."]
14561 pub base_mode: MavModeFlag,
14562 #[doc = "System status flag."]
14563 pub system_status: MavState,
14564 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14565 pub mavlink_version: u8,
14566}
14567impl HEARTBEAT_DATA {
14568 pub const ENCODED_LEN: usize = 9usize;
14569 pub const DEFAULT: Self = Self {
14570 custom_mode: 0_u32,
14571 mavtype: MavType::DEFAULT,
14572 autopilot: MavAutopilot::DEFAULT,
14573 base_mode: MavModeFlag::DEFAULT,
14574 system_status: MavState::DEFAULT,
14575 mavlink_version: MINOR_MAVLINK_VERSION,
14576 };
14577 #[cfg(feature = "arbitrary")]
14578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14579 use arbitrary::{Arbitrary, Unstructured};
14580 let mut buf = [0u8; 1024];
14581 rng.fill_bytes(&mut buf);
14582 let mut unstructured = Unstructured::new(&buf);
14583 Self::arbitrary(&mut unstructured).unwrap_or_default()
14584 }
14585}
14586impl Default for HEARTBEAT_DATA {
14587 fn default() -> Self {
14588 Self::DEFAULT.clone()
14589 }
14590}
14591impl MessageData for HEARTBEAT_DATA {
14592 type Message = MavMessage;
14593 const ID: u32 = 0u32;
14594 const NAME: &'static str = "HEARTBEAT";
14595 const EXTRA_CRC: u8 = 50u8;
14596 const ENCODED_LEN: usize = 9usize;
14597 fn deser(
14598 _version: MavlinkVersion,
14599 __input: &[u8],
14600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14601 let avail_len = __input.len();
14602 let mut payload_buf = [0; Self::ENCODED_LEN];
14603 let mut buf = if avail_len < Self::ENCODED_LEN {
14604 payload_buf[0..avail_len].copy_from_slice(__input);
14605 Bytes::new(&payload_buf)
14606 } else {
14607 Bytes::new(__input)
14608 };
14609 let mut __struct = Self::default();
14610 __struct.custom_mode = buf.get_u32_le();
14611 let tmp = buf.get_u8();
14612 __struct.mavtype =
14613 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14614 enum_type: "MavType",
14615 value: tmp as u32,
14616 })?;
14617 let tmp = buf.get_u8();
14618 __struct.autopilot =
14619 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14620 enum_type: "MavAutopilot",
14621 value: tmp as u32,
14622 })?;
14623 let tmp = buf.get_u8();
14624 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14625 ::mavlink_core::error::ParserError::InvalidFlag {
14626 flag_type: "MavModeFlag",
14627 value: tmp as u32,
14628 },
14629 )?;
14630 let tmp = buf.get_u8();
14631 __struct.system_status =
14632 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14633 enum_type: "MavState",
14634 value: tmp as u32,
14635 })?;
14636 __struct.mavlink_version = buf.get_u8();
14637 Ok(__struct)
14638 }
14639 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14640 let mut __tmp = BytesMut::new(bytes);
14641 #[allow(clippy::absurd_extreme_comparisons)]
14642 #[allow(unused_comparisons)]
14643 if __tmp.remaining() < Self::ENCODED_LEN {
14644 panic!(
14645 "buffer is too small (need {} bytes, but got {})",
14646 Self::ENCODED_LEN,
14647 __tmp.remaining(),
14648 )
14649 }
14650 __tmp.put_u32_le(self.custom_mode);
14651 __tmp.put_u8(self.mavtype as u8);
14652 __tmp.put_u8(self.autopilot as u8);
14653 __tmp.put_u8(self.base_mode.bits());
14654 __tmp.put_u8(self.system_status as u8);
14655 __tmp.put_u8(self.mavlink_version);
14656 if matches!(version, MavlinkVersion::V2) {
14657 let len = __tmp.len();
14658 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14659 } else {
14660 __tmp.len()
14661 }
14662 }
14663}
14664#[doc = "Herelink Telemetry."]
14665#[doc = ""]
14666#[doc = "ID: 50003"]
14667#[derive(Debug, Clone, PartialEq)]
14668#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14669#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14670pub struct HERELINK_TELEM_DATA {
14671 pub rf_freq: u32,
14672 pub link_bw: u32,
14673 pub link_rate: u32,
14674 pub snr: i16,
14675 pub cpu_temp: i16,
14676 pub board_temp: i16,
14677 pub rssi: u8,
14678}
14679impl HERELINK_TELEM_DATA {
14680 pub const ENCODED_LEN: usize = 19usize;
14681 pub const DEFAULT: Self = Self {
14682 rf_freq: 0_u32,
14683 link_bw: 0_u32,
14684 link_rate: 0_u32,
14685 snr: 0_i16,
14686 cpu_temp: 0_i16,
14687 board_temp: 0_i16,
14688 rssi: 0_u8,
14689 };
14690 #[cfg(feature = "arbitrary")]
14691 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14692 use arbitrary::{Arbitrary, Unstructured};
14693 let mut buf = [0u8; 1024];
14694 rng.fill_bytes(&mut buf);
14695 let mut unstructured = Unstructured::new(&buf);
14696 Self::arbitrary(&mut unstructured).unwrap_or_default()
14697 }
14698}
14699impl Default for HERELINK_TELEM_DATA {
14700 fn default() -> Self {
14701 Self::DEFAULT.clone()
14702 }
14703}
14704impl MessageData for HERELINK_TELEM_DATA {
14705 type Message = MavMessage;
14706 const ID: u32 = 50003u32;
14707 const NAME: &'static str = "HERELINK_TELEM";
14708 const EXTRA_CRC: u8 = 62u8;
14709 const ENCODED_LEN: usize = 19usize;
14710 fn deser(
14711 _version: MavlinkVersion,
14712 __input: &[u8],
14713 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14714 let avail_len = __input.len();
14715 let mut payload_buf = [0; Self::ENCODED_LEN];
14716 let mut buf = if avail_len < Self::ENCODED_LEN {
14717 payload_buf[0..avail_len].copy_from_slice(__input);
14718 Bytes::new(&payload_buf)
14719 } else {
14720 Bytes::new(__input)
14721 };
14722 let mut __struct = Self::default();
14723 __struct.rf_freq = buf.get_u32_le();
14724 __struct.link_bw = buf.get_u32_le();
14725 __struct.link_rate = buf.get_u32_le();
14726 __struct.snr = buf.get_i16_le();
14727 __struct.cpu_temp = buf.get_i16_le();
14728 __struct.board_temp = buf.get_i16_le();
14729 __struct.rssi = buf.get_u8();
14730 Ok(__struct)
14731 }
14732 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14733 let mut __tmp = BytesMut::new(bytes);
14734 #[allow(clippy::absurd_extreme_comparisons)]
14735 #[allow(unused_comparisons)]
14736 if __tmp.remaining() < Self::ENCODED_LEN {
14737 panic!(
14738 "buffer is too small (need {} bytes, but got {})",
14739 Self::ENCODED_LEN,
14740 __tmp.remaining(),
14741 )
14742 }
14743 __tmp.put_u32_le(self.rf_freq);
14744 __tmp.put_u32_le(self.link_bw);
14745 __tmp.put_u32_le(self.link_rate);
14746 __tmp.put_i16_le(self.snr);
14747 __tmp.put_i16_le(self.cpu_temp);
14748 __tmp.put_i16_le(self.board_temp);
14749 __tmp.put_u8(self.rssi);
14750 if matches!(version, MavlinkVersion::V2) {
14751 let len = __tmp.len();
14752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14753 } else {
14754 __tmp.len()
14755 }
14756 }
14757}
14758#[doc = "Information about video stream."]
14759#[doc = ""]
14760#[doc = "ID: 50002"]
14761#[derive(Debug, Clone, PartialEq)]
14762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14764pub struct HERELINK_VIDEO_STREAM_INFORMATION_DATA {
14765 #[doc = "Frame rate."]
14766 pub framerate: f32,
14767 #[doc = "Bit rate."]
14768 pub bitrate: u32,
14769 #[doc = "Horizontal resolution."]
14770 pub resolution_h: u16,
14771 #[doc = "Vertical resolution."]
14772 pub resolution_v: u16,
14773 #[doc = "Video image rotation clockwise."]
14774 pub rotation: u16,
14775 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
14776 pub camera_id: u8,
14777 #[doc = "Number of streams available."]
14778 pub status: u8,
14779 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
14780 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14781 pub uri: [u8; 230],
14782}
14783impl HERELINK_VIDEO_STREAM_INFORMATION_DATA {
14784 pub const ENCODED_LEN: usize = 246usize;
14785 pub const DEFAULT: Self = Self {
14786 framerate: 0.0_f32,
14787 bitrate: 0_u32,
14788 resolution_h: 0_u16,
14789 resolution_v: 0_u16,
14790 rotation: 0_u16,
14791 camera_id: 0_u8,
14792 status: 0_u8,
14793 uri: [0_u8; 230usize],
14794 };
14795 #[cfg(feature = "arbitrary")]
14796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14797 use arbitrary::{Arbitrary, Unstructured};
14798 let mut buf = [0u8; 1024];
14799 rng.fill_bytes(&mut buf);
14800 let mut unstructured = Unstructured::new(&buf);
14801 Self::arbitrary(&mut unstructured).unwrap_or_default()
14802 }
14803}
14804impl Default for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
14805 fn default() -> Self {
14806 Self::DEFAULT.clone()
14807 }
14808}
14809impl MessageData for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
14810 type Message = MavMessage;
14811 const ID: u32 = 50002u32;
14812 const NAME: &'static str = "HERELINK_VIDEO_STREAM_INFORMATION";
14813 const EXTRA_CRC: u8 = 181u8;
14814 const ENCODED_LEN: usize = 246usize;
14815 fn deser(
14816 _version: MavlinkVersion,
14817 __input: &[u8],
14818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14819 let avail_len = __input.len();
14820 let mut payload_buf = [0; Self::ENCODED_LEN];
14821 let mut buf = if avail_len < Self::ENCODED_LEN {
14822 payload_buf[0..avail_len].copy_from_slice(__input);
14823 Bytes::new(&payload_buf)
14824 } else {
14825 Bytes::new(__input)
14826 };
14827 let mut __struct = Self::default();
14828 __struct.framerate = buf.get_f32_le();
14829 __struct.bitrate = buf.get_u32_le();
14830 __struct.resolution_h = buf.get_u16_le();
14831 __struct.resolution_v = buf.get_u16_le();
14832 __struct.rotation = buf.get_u16_le();
14833 __struct.camera_id = buf.get_u8();
14834 __struct.status = buf.get_u8();
14835 for v in &mut __struct.uri {
14836 let val = buf.get_u8();
14837 *v = val;
14838 }
14839 Ok(__struct)
14840 }
14841 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14842 let mut __tmp = BytesMut::new(bytes);
14843 #[allow(clippy::absurd_extreme_comparisons)]
14844 #[allow(unused_comparisons)]
14845 if __tmp.remaining() < Self::ENCODED_LEN {
14846 panic!(
14847 "buffer is too small (need {} bytes, but got {})",
14848 Self::ENCODED_LEN,
14849 __tmp.remaining(),
14850 )
14851 }
14852 __tmp.put_f32_le(self.framerate);
14853 __tmp.put_u32_le(self.bitrate);
14854 __tmp.put_u16_le(self.resolution_h);
14855 __tmp.put_u16_le(self.resolution_v);
14856 __tmp.put_u16_le(self.rotation);
14857 __tmp.put_u8(self.camera_id);
14858 __tmp.put_u8(self.status);
14859 for val in &self.uri {
14860 __tmp.put_u8(*val);
14861 }
14862 if matches!(version, MavlinkVersion::V2) {
14863 let len = __tmp.len();
14864 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14865 } else {
14866 __tmp.len()
14867 }
14868 }
14869}
14870#[doc = "The IMU readings in SI units in NED body frame."]
14871#[doc = ""]
14872#[doc = "ID: 105"]
14873#[derive(Debug, Clone, PartialEq)]
14874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14875#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14876pub struct HIGHRES_IMU_DATA {
14877 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14878 pub time_usec: u64,
14879 #[doc = "X acceleration"]
14880 pub xacc: f32,
14881 #[doc = "Y acceleration"]
14882 pub yacc: f32,
14883 #[doc = "Z acceleration"]
14884 pub zacc: f32,
14885 #[doc = "Angular speed around X axis"]
14886 pub xgyro: f32,
14887 #[doc = "Angular speed around Y axis"]
14888 pub ygyro: f32,
14889 #[doc = "Angular speed around Z axis"]
14890 pub zgyro: f32,
14891 #[doc = "X Magnetic field"]
14892 pub xmag: f32,
14893 #[doc = "Y Magnetic field"]
14894 pub ymag: f32,
14895 #[doc = "Z Magnetic field"]
14896 pub zmag: f32,
14897 #[doc = "Absolute pressure"]
14898 pub abs_pressure: f32,
14899 #[doc = "Differential pressure"]
14900 pub diff_pressure: f32,
14901 #[doc = "Altitude calculated from pressure"]
14902 pub pressure_alt: f32,
14903 #[doc = "Temperature"]
14904 pub temperature: f32,
14905 #[doc = "Bitmap for fields that have updated since last message"]
14906 pub fields_updated: HighresImuUpdatedFlags,
14907 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14908 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14909 pub id: u8,
14910}
14911impl HIGHRES_IMU_DATA {
14912 pub const ENCODED_LEN: usize = 63usize;
14913 pub const DEFAULT: Self = Self {
14914 time_usec: 0_u64,
14915 xacc: 0.0_f32,
14916 yacc: 0.0_f32,
14917 zacc: 0.0_f32,
14918 xgyro: 0.0_f32,
14919 ygyro: 0.0_f32,
14920 zgyro: 0.0_f32,
14921 xmag: 0.0_f32,
14922 ymag: 0.0_f32,
14923 zmag: 0.0_f32,
14924 abs_pressure: 0.0_f32,
14925 diff_pressure: 0.0_f32,
14926 pressure_alt: 0.0_f32,
14927 temperature: 0.0_f32,
14928 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14929 id: 0_u8,
14930 };
14931 #[cfg(feature = "arbitrary")]
14932 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14933 use arbitrary::{Arbitrary, Unstructured};
14934 let mut buf = [0u8; 1024];
14935 rng.fill_bytes(&mut buf);
14936 let mut unstructured = Unstructured::new(&buf);
14937 Self::arbitrary(&mut unstructured).unwrap_or_default()
14938 }
14939}
14940impl Default for HIGHRES_IMU_DATA {
14941 fn default() -> Self {
14942 Self::DEFAULT.clone()
14943 }
14944}
14945impl MessageData for HIGHRES_IMU_DATA {
14946 type Message = MavMessage;
14947 const ID: u32 = 105u32;
14948 const NAME: &'static str = "HIGHRES_IMU";
14949 const EXTRA_CRC: u8 = 93u8;
14950 const ENCODED_LEN: usize = 63usize;
14951 fn deser(
14952 _version: MavlinkVersion,
14953 __input: &[u8],
14954 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14955 let avail_len = __input.len();
14956 let mut payload_buf = [0; Self::ENCODED_LEN];
14957 let mut buf = if avail_len < Self::ENCODED_LEN {
14958 payload_buf[0..avail_len].copy_from_slice(__input);
14959 Bytes::new(&payload_buf)
14960 } else {
14961 Bytes::new(__input)
14962 };
14963 let mut __struct = Self::default();
14964 __struct.time_usec = buf.get_u64_le();
14965 __struct.xacc = buf.get_f32_le();
14966 __struct.yacc = buf.get_f32_le();
14967 __struct.zacc = buf.get_f32_le();
14968 __struct.xgyro = buf.get_f32_le();
14969 __struct.ygyro = buf.get_f32_le();
14970 __struct.zgyro = buf.get_f32_le();
14971 __struct.xmag = buf.get_f32_le();
14972 __struct.ymag = buf.get_f32_le();
14973 __struct.zmag = buf.get_f32_le();
14974 __struct.abs_pressure = buf.get_f32_le();
14975 __struct.diff_pressure = buf.get_f32_le();
14976 __struct.pressure_alt = buf.get_f32_le();
14977 __struct.temperature = buf.get_f32_le();
14978 let tmp = buf.get_u16_le();
14979 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
14980 tmp & HighresImuUpdatedFlags::all().bits(),
14981 )
14982 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14983 flag_type: "HighresImuUpdatedFlags",
14984 value: tmp as u32,
14985 })?;
14986 __struct.id = buf.get_u8();
14987 Ok(__struct)
14988 }
14989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14990 let mut __tmp = BytesMut::new(bytes);
14991 #[allow(clippy::absurd_extreme_comparisons)]
14992 #[allow(unused_comparisons)]
14993 if __tmp.remaining() < Self::ENCODED_LEN {
14994 panic!(
14995 "buffer is too small (need {} bytes, but got {})",
14996 Self::ENCODED_LEN,
14997 __tmp.remaining(),
14998 )
14999 }
15000 __tmp.put_u64_le(self.time_usec);
15001 __tmp.put_f32_le(self.xacc);
15002 __tmp.put_f32_le(self.yacc);
15003 __tmp.put_f32_le(self.zacc);
15004 __tmp.put_f32_le(self.xgyro);
15005 __tmp.put_f32_le(self.ygyro);
15006 __tmp.put_f32_le(self.zgyro);
15007 __tmp.put_f32_le(self.xmag);
15008 __tmp.put_f32_le(self.ymag);
15009 __tmp.put_f32_le(self.zmag);
15010 __tmp.put_f32_le(self.abs_pressure);
15011 __tmp.put_f32_le(self.diff_pressure);
15012 __tmp.put_f32_le(self.pressure_alt);
15013 __tmp.put_f32_le(self.temperature);
15014 __tmp.put_u16_le(self.fields_updated.bits());
15015 if matches!(version, MavlinkVersion::V2) {
15016 __tmp.put_u8(self.id);
15017 let len = __tmp.len();
15018 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15019 } else {
15020 __tmp.len()
15021 }
15022 }
15023}
15024#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15025#[doc = "Message appropriate for high latency connections like Iridium."]
15026#[doc = ""]
15027#[doc = "ID: 234"]
15028#[derive(Debug, Clone, PartialEq)]
15029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15031pub struct HIGH_LATENCY_DATA {
15032 #[doc = "A bitfield for use for autopilot-specific flags."]
15033 pub custom_mode: u32,
15034 #[doc = "Latitude"]
15035 pub latitude: i32,
15036 #[doc = "Longitude"]
15037 pub longitude: i32,
15038 #[doc = "roll"]
15039 pub roll: i16,
15040 #[doc = "pitch"]
15041 pub pitch: i16,
15042 #[doc = "heading"]
15043 pub heading: u16,
15044 #[doc = "heading setpoint"]
15045 pub heading_sp: i16,
15046 #[doc = "Altitude above mean sea level"]
15047 pub altitude_amsl: i16,
15048 #[doc = "Altitude setpoint relative to the home position"]
15049 pub altitude_sp: i16,
15050 #[doc = "distance to target"]
15051 pub wp_distance: u16,
15052 #[doc = "Bitmap of enabled system modes."]
15053 pub base_mode: MavModeFlag,
15054 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15055 pub landed_state: MavLandedState,
15056 #[doc = "throttle (percentage)"]
15057 pub throttle: i8,
15058 #[doc = "airspeed"]
15059 pub airspeed: u8,
15060 #[doc = "airspeed setpoint"]
15061 pub airspeed_sp: u8,
15062 #[doc = "groundspeed"]
15063 pub groundspeed: u8,
15064 #[doc = "climb rate"]
15065 pub climb_rate: i8,
15066 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15067 pub gps_nsat: u8,
15068 #[doc = "GPS Fix type."]
15069 pub gps_fix_type: GpsFixType,
15070 #[doc = "Remaining battery (percentage)"]
15071 pub battery_remaining: u8,
15072 #[doc = "Autopilot temperature (degrees C)"]
15073 pub temperature: i8,
15074 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15075 pub temperature_air: i8,
15076 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15077 pub failsafe: u8,
15078 #[doc = "current waypoint number"]
15079 pub wp_num: u8,
15080}
15081impl HIGH_LATENCY_DATA {
15082 pub const ENCODED_LEN: usize = 40usize;
15083 pub const DEFAULT: Self = Self {
15084 custom_mode: 0_u32,
15085 latitude: 0_i32,
15086 longitude: 0_i32,
15087 roll: 0_i16,
15088 pitch: 0_i16,
15089 heading: 0_u16,
15090 heading_sp: 0_i16,
15091 altitude_amsl: 0_i16,
15092 altitude_sp: 0_i16,
15093 wp_distance: 0_u16,
15094 base_mode: MavModeFlag::DEFAULT,
15095 landed_state: MavLandedState::DEFAULT,
15096 throttle: 0_i8,
15097 airspeed: 0_u8,
15098 airspeed_sp: 0_u8,
15099 groundspeed: 0_u8,
15100 climb_rate: 0_i8,
15101 gps_nsat: 0_u8,
15102 gps_fix_type: GpsFixType::DEFAULT,
15103 battery_remaining: 0_u8,
15104 temperature: 0_i8,
15105 temperature_air: 0_i8,
15106 failsafe: 0_u8,
15107 wp_num: 0_u8,
15108 };
15109 #[cfg(feature = "arbitrary")]
15110 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15111 use arbitrary::{Arbitrary, Unstructured};
15112 let mut buf = [0u8; 1024];
15113 rng.fill_bytes(&mut buf);
15114 let mut unstructured = Unstructured::new(&buf);
15115 Self::arbitrary(&mut unstructured).unwrap_or_default()
15116 }
15117}
15118impl Default for HIGH_LATENCY_DATA {
15119 fn default() -> Self {
15120 Self::DEFAULT.clone()
15121 }
15122}
15123impl MessageData for HIGH_LATENCY_DATA {
15124 type Message = MavMessage;
15125 const ID: u32 = 234u32;
15126 const NAME: &'static str = "HIGH_LATENCY";
15127 const EXTRA_CRC: u8 = 150u8;
15128 const ENCODED_LEN: usize = 40usize;
15129 fn deser(
15130 _version: MavlinkVersion,
15131 __input: &[u8],
15132 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15133 let avail_len = __input.len();
15134 let mut payload_buf = [0; Self::ENCODED_LEN];
15135 let mut buf = if avail_len < Self::ENCODED_LEN {
15136 payload_buf[0..avail_len].copy_from_slice(__input);
15137 Bytes::new(&payload_buf)
15138 } else {
15139 Bytes::new(__input)
15140 };
15141 let mut __struct = Self::default();
15142 __struct.custom_mode = buf.get_u32_le();
15143 __struct.latitude = buf.get_i32_le();
15144 __struct.longitude = buf.get_i32_le();
15145 __struct.roll = buf.get_i16_le();
15146 __struct.pitch = buf.get_i16_le();
15147 __struct.heading = buf.get_u16_le();
15148 __struct.heading_sp = buf.get_i16_le();
15149 __struct.altitude_amsl = buf.get_i16_le();
15150 __struct.altitude_sp = buf.get_i16_le();
15151 __struct.wp_distance = buf.get_u16_le();
15152 let tmp = buf.get_u8();
15153 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15154 ::mavlink_core::error::ParserError::InvalidFlag {
15155 flag_type: "MavModeFlag",
15156 value: tmp as u32,
15157 },
15158 )?;
15159 let tmp = buf.get_u8();
15160 __struct.landed_state =
15161 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15162 enum_type: "MavLandedState",
15163 value: tmp as u32,
15164 })?;
15165 __struct.throttle = buf.get_i8();
15166 __struct.airspeed = buf.get_u8();
15167 __struct.airspeed_sp = buf.get_u8();
15168 __struct.groundspeed = buf.get_u8();
15169 __struct.climb_rate = buf.get_i8();
15170 __struct.gps_nsat = buf.get_u8();
15171 let tmp = buf.get_u8();
15172 __struct.gps_fix_type =
15173 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15174 enum_type: "GpsFixType",
15175 value: tmp as u32,
15176 })?;
15177 __struct.battery_remaining = buf.get_u8();
15178 __struct.temperature = buf.get_i8();
15179 __struct.temperature_air = buf.get_i8();
15180 __struct.failsafe = buf.get_u8();
15181 __struct.wp_num = buf.get_u8();
15182 Ok(__struct)
15183 }
15184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15185 let mut __tmp = BytesMut::new(bytes);
15186 #[allow(clippy::absurd_extreme_comparisons)]
15187 #[allow(unused_comparisons)]
15188 if __tmp.remaining() < Self::ENCODED_LEN {
15189 panic!(
15190 "buffer is too small (need {} bytes, but got {})",
15191 Self::ENCODED_LEN,
15192 __tmp.remaining(),
15193 )
15194 }
15195 __tmp.put_u32_le(self.custom_mode);
15196 __tmp.put_i32_le(self.latitude);
15197 __tmp.put_i32_le(self.longitude);
15198 __tmp.put_i16_le(self.roll);
15199 __tmp.put_i16_le(self.pitch);
15200 __tmp.put_u16_le(self.heading);
15201 __tmp.put_i16_le(self.heading_sp);
15202 __tmp.put_i16_le(self.altitude_amsl);
15203 __tmp.put_i16_le(self.altitude_sp);
15204 __tmp.put_u16_le(self.wp_distance);
15205 __tmp.put_u8(self.base_mode.bits());
15206 __tmp.put_u8(self.landed_state as u8);
15207 __tmp.put_i8(self.throttle);
15208 __tmp.put_u8(self.airspeed);
15209 __tmp.put_u8(self.airspeed_sp);
15210 __tmp.put_u8(self.groundspeed);
15211 __tmp.put_i8(self.climb_rate);
15212 __tmp.put_u8(self.gps_nsat);
15213 __tmp.put_u8(self.gps_fix_type as u8);
15214 __tmp.put_u8(self.battery_remaining);
15215 __tmp.put_i8(self.temperature);
15216 __tmp.put_i8(self.temperature_air);
15217 __tmp.put_u8(self.failsafe);
15218 __tmp.put_u8(self.wp_num);
15219 if matches!(version, MavlinkVersion::V2) {
15220 let len = __tmp.len();
15221 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15222 } else {
15223 __tmp.len()
15224 }
15225 }
15226}
15227#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15228#[doc = ""]
15229#[doc = "ID: 235"]
15230#[derive(Debug, Clone, PartialEq)]
15231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15233pub struct HIGH_LATENCY2_DATA {
15234 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15235 pub timestamp: u32,
15236 #[doc = "Latitude"]
15237 pub latitude: i32,
15238 #[doc = "Longitude"]
15239 pub longitude: i32,
15240 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15241 pub custom_mode: u16,
15242 #[doc = "Altitude above mean sea level"]
15243 pub altitude: i16,
15244 #[doc = "Altitude setpoint"]
15245 pub target_altitude: i16,
15246 #[doc = "Distance to target waypoint or position"]
15247 pub target_distance: u16,
15248 #[doc = "Current waypoint number"]
15249 pub wp_num: u16,
15250 #[doc = "Bitmap of failure flags."]
15251 pub failure_flags: HlFailureFlag,
15252 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15253 pub mavtype: MavType,
15254 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15255 pub autopilot: MavAutopilot,
15256 #[doc = "Heading"]
15257 pub heading: u8,
15258 #[doc = "Heading setpoint"]
15259 pub target_heading: u8,
15260 #[doc = "Throttle"]
15261 pub throttle: u8,
15262 #[doc = "Airspeed"]
15263 pub airspeed: u8,
15264 #[doc = "Airspeed setpoint"]
15265 pub airspeed_sp: u8,
15266 #[doc = "Groundspeed"]
15267 pub groundspeed: u8,
15268 #[doc = "Windspeed"]
15269 pub windspeed: u8,
15270 #[doc = "Wind heading"]
15271 pub wind_heading: u8,
15272 #[doc = "Maximum error horizontal position since last message"]
15273 pub eph: u8,
15274 #[doc = "Maximum error vertical position since last message"]
15275 pub epv: u8,
15276 #[doc = "Air temperature"]
15277 pub temperature_air: i8,
15278 #[doc = "Maximum climb rate magnitude since last message"]
15279 pub climb_rate: i8,
15280 #[doc = "Battery level (-1 if field not provided)."]
15281 pub battery: i8,
15282 #[doc = "Field for custom payload."]
15283 pub custom0: i8,
15284 #[doc = "Field for custom payload."]
15285 pub custom1: i8,
15286 #[doc = "Field for custom payload."]
15287 pub custom2: i8,
15288}
15289impl HIGH_LATENCY2_DATA {
15290 pub const ENCODED_LEN: usize = 42usize;
15291 pub const DEFAULT: Self = Self {
15292 timestamp: 0_u32,
15293 latitude: 0_i32,
15294 longitude: 0_i32,
15295 custom_mode: 0_u16,
15296 altitude: 0_i16,
15297 target_altitude: 0_i16,
15298 target_distance: 0_u16,
15299 wp_num: 0_u16,
15300 failure_flags: HlFailureFlag::DEFAULT,
15301 mavtype: MavType::DEFAULT,
15302 autopilot: MavAutopilot::DEFAULT,
15303 heading: 0_u8,
15304 target_heading: 0_u8,
15305 throttle: 0_u8,
15306 airspeed: 0_u8,
15307 airspeed_sp: 0_u8,
15308 groundspeed: 0_u8,
15309 windspeed: 0_u8,
15310 wind_heading: 0_u8,
15311 eph: 0_u8,
15312 epv: 0_u8,
15313 temperature_air: 0_i8,
15314 climb_rate: 0_i8,
15315 battery: 0_i8,
15316 custom0: 0_i8,
15317 custom1: 0_i8,
15318 custom2: 0_i8,
15319 };
15320 #[cfg(feature = "arbitrary")]
15321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15322 use arbitrary::{Arbitrary, Unstructured};
15323 let mut buf = [0u8; 1024];
15324 rng.fill_bytes(&mut buf);
15325 let mut unstructured = Unstructured::new(&buf);
15326 Self::arbitrary(&mut unstructured).unwrap_or_default()
15327 }
15328}
15329impl Default for HIGH_LATENCY2_DATA {
15330 fn default() -> Self {
15331 Self::DEFAULT.clone()
15332 }
15333}
15334impl MessageData for HIGH_LATENCY2_DATA {
15335 type Message = MavMessage;
15336 const ID: u32 = 235u32;
15337 const NAME: &'static str = "HIGH_LATENCY2";
15338 const EXTRA_CRC: u8 = 179u8;
15339 const ENCODED_LEN: usize = 42usize;
15340 fn deser(
15341 _version: MavlinkVersion,
15342 __input: &[u8],
15343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15344 let avail_len = __input.len();
15345 let mut payload_buf = [0; Self::ENCODED_LEN];
15346 let mut buf = if avail_len < Self::ENCODED_LEN {
15347 payload_buf[0..avail_len].copy_from_slice(__input);
15348 Bytes::new(&payload_buf)
15349 } else {
15350 Bytes::new(__input)
15351 };
15352 let mut __struct = Self::default();
15353 __struct.timestamp = buf.get_u32_le();
15354 __struct.latitude = buf.get_i32_le();
15355 __struct.longitude = buf.get_i32_le();
15356 __struct.custom_mode = buf.get_u16_le();
15357 __struct.altitude = buf.get_i16_le();
15358 __struct.target_altitude = buf.get_i16_le();
15359 __struct.target_distance = buf.get_u16_le();
15360 __struct.wp_num = buf.get_u16_le();
15361 let tmp = buf.get_u16_le();
15362 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15363 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15364 flag_type: "HlFailureFlag",
15365 value: tmp as u32,
15366 })?;
15367 let tmp = buf.get_u8();
15368 __struct.mavtype =
15369 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15370 enum_type: "MavType",
15371 value: tmp as u32,
15372 })?;
15373 let tmp = buf.get_u8();
15374 __struct.autopilot =
15375 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15376 enum_type: "MavAutopilot",
15377 value: tmp as u32,
15378 })?;
15379 __struct.heading = buf.get_u8();
15380 __struct.target_heading = buf.get_u8();
15381 __struct.throttle = buf.get_u8();
15382 __struct.airspeed = buf.get_u8();
15383 __struct.airspeed_sp = buf.get_u8();
15384 __struct.groundspeed = buf.get_u8();
15385 __struct.windspeed = buf.get_u8();
15386 __struct.wind_heading = buf.get_u8();
15387 __struct.eph = buf.get_u8();
15388 __struct.epv = buf.get_u8();
15389 __struct.temperature_air = buf.get_i8();
15390 __struct.climb_rate = buf.get_i8();
15391 __struct.battery = buf.get_i8();
15392 __struct.custom0 = buf.get_i8();
15393 __struct.custom1 = buf.get_i8();
15394 __struct.custom2 = buf.get_i8();
15395 Ok(__struct)
15396 }
15397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15398 let mut __tmp = BytesMut::new(bytes);
15399 #[allow(clippy::absurd_extreme_comparisons)]
15400 #[allow(unused_comparisons)]
15401 if __tmp.remaining() < Self::ENCODED_LEN {
15402 panic!(
15403 "buffer is too small (need {} bytes, but got {})",
15404 Self::ENCODED_LEN,
15405 __tmp.remaining(),
15406 )
15407 }
15408 __tmp.put_u32_le(self.timestamp);
15409 __tmp.put_i32_le(self.latitude);
15410 __tmp.put_i32_le(self.longitude);
15411 __tmp.put_u16_le(self.custom_mode);
15412 __tmp.put_i16_le(self.altitude);
15413 __tmp.put_i16_le(self.target_altitude);
15414 __tmp.put_u16_le(self.target_distance);
15415 __tmp.put_u16_le(self.wp_num);
15416 __tmp.put_u16_le(self.failure_flags.bits());
15417 __tmp.put_u8(self.mavtype as u8);
15418 __tmp.put_u8(self.autopilot as u8);
15419 __tmp.put_u8(self.heading);
15420 __tmp.put_u8(self.target_heading);
15421 __tmp.put_u8(self.throttle);
15422 __tmp.put_u8(self.airspeed);
15423 __tmp.put_u8(self.airspeed_sp);
15424 __tmp.put_u8(self.groundspeed);
15425 __tmp.put_u8(self.windspeed);
15426 __tmp.put_u8(self.wind_heading);
15427 __tmp.put_u8(self.eph);
15428 __tmp.put_u8(self.epv);
15429 __tmp.put_i8(self.temperature_air);
15430 __tmp.put_i8(self.climb_rate);
15431 __tmp.put_i8(self.battery);
15432 __tmp.put_i8(self.custom0);
15433 __tmp.put_i8(self.custom1);
15434 __tmp.put_i8(self.custom2);
15435 if matches!(version, MavlinkVersion::V2) {
15436 let len = __tmp.len();
15437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15438 } else {
15439 __tmp.len()
15440 }
15441 }
15442}
15443#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15444#[doc = ""]
15445#[doc = "ID: 93"]
15446#[derive(Debug, Clone, PartialEq)]
15447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15449pub struct HIL_ACTUATOR_CONTROLS_DATA {
15450 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15451 pub time_usec: u64,
15452 #[doc = "Flags bitmask."]
15453 pub flags: HilActuatorControlsFlags,
15454 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15455 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15456 pub controls: [f32; 16],
15457 #[doc = "System mode. Includes arming state."]
15458 pub mode: MavModeFlag,
15459}
15460impl HIL_ACTUATOR_CONTROLS_DATA {
15461 pub const ENCODED_LEN: usize = 81usize;
15462 pub const DEFAULT: Self = Self {
15463 time_usec: 0_u64,
15464 flags: HilActuatorControlsFlags::DEFAULT,
15465 controls: [0.0_f32; 16usize],
15466 mode: MavModeFlag::DEFAULT,
15467 };
15468 #[cfg(feature = "arbitrary")]
15469 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15470 use arbitrary::{Arbitrary, Unstructured};
15471 let mut buf = [0u8; 1024];
15472 rng.fill_bytes(&mut buf);
15473 let mut unstructured = Unstructured::new(&buf);
15474 Self::arbitrary(&mut unstructured).unwrap_or_default()
15475 }
15476}
15477impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15478 fn default() -> Self {
15479 Self::DEFAULT.clone()
15480 }
15481}
15482impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15483 type Message = MavMessage;
15484 const ID: u32 = 93u32;
15485 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15486 const EXTRA_CRC: u8 = 47u8;
15487 const ENCODED_LEN: usize = 81usize;
15488 fn deser(
15489 _version: MavlinkVersion,
15490 __input: &[u8],
15491 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15492 let avail_len = __input.len();
15493 let mut payload_buf = [0; Self::ENCODED_LEN];
15494 let mut buf = if avail_len < Self::ENCODED_LEN {
15495 payload_buf[0..avail_len].copy_from_slice(__input);
15496 Bytes::new(&payload_buf)
15497 } else {
15498 Bytes::new(__input)
15499 };
15500 let mut __struct = Self::default();
15501 __struct.time_usec = buf.get_u64_le();
15502 let tmp = buf.get_u64_le();
15503 __struct.flags =
15504 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15505 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15506 flag_type: "HilActuatorControlsFlags",
15507 value: tmp as u32,
15508 })?;
15509 for v in &mut __struct.controls {
15510 let val = buf.get_f32_le();
15511 *v = val;
15512 }
15513 let tmp = buf.get_u8();
15514 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15515 ::mavlink_core::error::ParserError::InvalidFlag {
15516 flag_type: "MavModeFlag",
15517 value: tmp as u32,
15518 },
15519 )?;
15520 Ok(__struct)
15521 }
15522 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15523 let mut __tmp = BytesMut::new(bytes);
15524 #[allow(clippy::absurd_extreme_comparisons)]
15525 #[allow(unused_comparisons)]
15526 if __tmp.remaining() < Self::ENCODED_LEN {
15527 panic!(
15528 "buffer is too small (need {} bytes, but got {})",
15529 Self::ENCODED_LEN,
15530 __tmp.remaining(),
15531 )
15532 }
15533 __tmp.put_u64_le(self.time_usec);
15534 __tmp.put_u64_le(self.flags.bits());
15535 for val in &self.controls {
15536 __tmp.put_f32_le(*val);
15537 }
15538 __tmp.put_u8(self.mode.bits());
15539 if matches!(version, MavlinkVersion::V2) {
15540 let len = __tmp.len();
15541 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15542 } else {
15543 __tmp.len()
15544 }
15545 }
15546}
15547#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15548#[doc = ""]
15549#[doc = "ID: 91"]
15550#[derive(Debug, Clone, PartialEq)]
15551#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15553pub struct HIL_CONTROLS_DATA {
15554 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15555 pub time_usec: u64,
15556 #[doc = "Control output -1 .. 1"]
15557 pub roll_ailerons: f32,
15558 #[doc = "Control output -1 .. 1"]
15559 pub pitch_elevator: f32,
15560 #[doc = "Control output -1 .. 1"]
15561 pub yaw_rudder: f32,
15562 #[doc = "Throttle 0 .. 1"]
15563 pub throttle: f32,
15564 #[doc = "Aux 1, -1 .. 1"]
15565 pub aux1: f32,
15566 #[doc = "Aux 2, -1 .. 1"]
15567 pub aux2: f32,
15568 #[doc = "Aux 3, -1 .. 1"]
15569 pub aux3: f32,
15570 #[doc = "Aux 4, -1 .. 1"]
15571 pub aux4: f32,
15572 #[doc = "System mode."]
15573 pub mode: MavMode,
15574 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15575 pub nav_mode: u8,
15576}
15577impl HIL_CONTROLS_DATA {
15578 pub const ENCODED_LEN: usize = 42usize;
15579 pub const DEFAULT: Self = Self {
15580 time_usec: 0_u64,
15581 roll_ailerons: 0.0_f32,
15582 pitch_elevator: 0.0_f32,
15583 yaw_rudder: 0.0_f32,
15584 throttle: 0.0_f32,
15585 aux1: 0.0_f32,
15586 aux2: 0.0_f32,
15587 aux3: 0.0_f32,
15588 aux4: 0.0_f32,
15589 mode: MavMode::DEFAULT,
15590 nav_mode: 0_u8,
15591 };
15592 #[cfg(feature = "arbitrary")]
15593 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15594 use arbitrary::{Arbitrary, Unstructured};
15595 let mut buf = [0u8; 1024];
15596 rng.fill_bytes(&mut buf);
15597 let mut unstructured = Unstructured::new(&buf);
15598 Self::arbitrary(&mut unstructured).unwrap_or_default()
15599 }
15600}
15601impl Default for HIL_CONTROLS_DATA {
15602 fn default() -> Self {
15603 Self::DEFAULT.clone()
15604 }
15605}
15606impl MessageData for HIL_CONTROLS_DATA {
15607 type Message = MavMessage;
15608 const ID: u32 = 91u32;
15609 const NAME: &'static str = "HIL_CONTROLS";
15610 const EXTRA_CRC: u8 = 63u8;
15611 const ENCODED_LEN: usize = 42usize;
15612 fn deser(
15613 _version: MavlinkVersion,
15614 __input: &[u8],
15615 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15616 let avail_len = __input.len();
15617 let mut payload_buf = [0; Self::ENCODED_LEN];
15618 let mut buf = if avail_len < Self::ENCODED_LEN {
15619 payload_buf[0..avail_len].copy_from_slice(__input);
15620 Bytes::new(&payload_buf)
15621 } else {
15622 Bytes::new(__input)
15623 };
15624 let mut __struct = Self::default();
15625 __struct.time_usec = buf.get_u64_le();
15626 __struct.roll_ailerons = buf.get_f32_le();
15627 __struct.pitch_elevator = buf.get_f32_le();
15628 __struct.yaw_rudder = buf.get_f32_le();
15629 __struct.throttle = buf.get_f32_le();
15630 __struct.aux1 = buf.get_f32_le();
15631 __struct.aux2 = buf.get_f32_le();
15632 __struct.aux3 = buf.get_f32_le();
15633 __struct.aux4 = buf.get_f32_le();
15634 let tmp = buf.get_u8();
15635 __struct.mode =
15636 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15637 enum_type: "MavMode",
15638 value: tmp as u32,
15639 })?;
15640 __struct.nav_mode = buf.get_u8();
15641 Ok(__struct)
15642 }
15643 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15644 let mut __tmp = BytesMut::new(bytes);
15645 #[allow(clippy::absurd_extreme_comparisons)]
15646 #[allow(unused_comparisons)]
15647 if __tmp.remaining() < Self::ENCODED_LEN {
15648 panic!(
15649 "buffer is too small (need {} bytes, but got {})",
15650 Self::ENCODED_LEN,
15651 __tmp.remaining(),
15652 )
15653 }
15654 __tmp.put_u64_le(self.time_usec);
15655 __tmp.put_f32_le(self.roll_ailerons);
15656 __tmp.put_f32_le(self.pitch_elevator);
15657 __tmp.put_f32_le(self.yaw_rudder);
15658 __tmp.put_f32_le(self.throttle);
15659 __tmp.put_f32_le(self.aux1);
15660 __tmp.put_f32_le(self.aux2);
15661 __tmp.put_f32_le(self.aux3);
15662 __tmp.put_f32_le(self.aux4);
15663 __tmp.put_u8(self.mode as u8);
15664 __tmp.put_u8(self.nav_mode);
15665 if matches!(version, MavlinkVersion::V2) {
15666 let len = __tmp.len();
15667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15668 } else {
15669 __tmp.len()
15670 }
15671 }
15672}
15673#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15674#[doc = ""]
15675#[doc = "ID: 113"]
15676#[derive(Debug, Clone, PartialEq)]
15677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15679pub struct HIL_GPS_DATA {
15680 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15681 pub time_usec: u64,
15682 #[doc = "Latitude (WGS84)"]
15683 pub lat: i32,
15684 #[doc = "Longitude (WGS84)"]
15685 pub lon: i32,
15686 #[doc = "Altitude (MSL). Positive for up."]
15687 pub alt: i32,
15688 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15689 pub eph: u16,
15690 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15691 pub epv: u16,
15692 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15693 pub vel: u16,
15694 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15695 pub vn: i16,
15696 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15697 pub ve: i16,
15698 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15699 pub vd: i16,
15700 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15701 pub cog: u16,
15702 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15703 pub fix_type: u8,
15704 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15705 pub satellites_visible: u8,
15706 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15707 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15708 pub id: u8,
15709 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15710 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15711 pub yaw: u16,
15712}
15713impl HIL_GPS_DATA {
15714 pub const ENCODED_LEN: usize = 39usize;
15715 pub const DEFAULT: Self = Self {
15716 time_usec: 0_u64,
15717 lat: 0_i32,
15718 lon: 0_i32,
15719 alt: 0_i32,
15720 eph: 0_u16,
15721 epv: 0_u16,
15722 vel: 0_u16,
15723 vn: 0_i16,
15724 ve: 0_i16,
15725 vd: 0_i16,
15726 cog: 0_u16,
15727 fix_type: 0_u8,
15728 satellites_visible: 0_u8,
15729 id: 0_u8,
15730 yaw: 0_u16,
15731 };
15732 #[cfg(feature = "arbitrary")]
15733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15734 use arbitrary::{Arbitrary, Unstructured};
15735 let mut buf = [0u8; 1024];
15736 rng.fill_bytes(&mut buf);
15737 let mut unstructured = Unstructured::new(&buf);
15738 Self::arbitrary(&mut unstructured).unwrap_or_default()
15739 }
15740}
15741impl Default for HIL_GPS_DATA {
15742 fn default() -> Self {
15743 Self::DEFAULT.clone()
15744 }
15745}
15746impl MessageData for HIL_GPS_DATA {
15747 type Message = MavMessage;
15748 const ID: u32 = 113u32;
15749 const NAME: &'static str = "HIL_GPS";
15750 const EXTRA_CRC: u8 = 124u8;
15751 const ENCODED_LEN: usize = 39usize;
15752 fn deser(
15753 _version: MavlinkVersion,
15754 __input: &[u8],
15755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15756 let avail_len = __input.len();
15757 let mut payload_buf = [0; Self::ENCODED_LEN];
15758 let mut buf = if avail_len < Self::ENCODED_LEN {
15759 payload_buf[0..avail_len].copy_from_slice(__input);
15760 Bytes::new(&payload_buf)
15761 } else {
15762 Bytes::new(__input)
15763 };
15764 let mut __struct = Self::default();
15765 __struct.time_usec = buf.get_u64_le();
15766 __struct.lat = buf.get_i32_le();
15767 __struct.lon = buf.get_i32_le();
15768 __struct.alt = buf.get_i32_le();
15769 __struct.eph = buf.get_u16_le();
15770 __struct.epv = buf.get_u16_le();
15771 __struct.vel = buf.get_u16_le();
15772 __struct.vn = buf.get_i16_le();
15773 __struct.ve = buf.get_i16_le();
15774 __struct.vd = buf.get_i16_le();
15775 __struct.cog = buf.get_u16_le();
15776 __struct.fix_type = buf.get_u8();
15777 __struct.satellites_visible = buf.get_u8();
15778 __struct.id = buf.get_u8();
15779 __struct.yaw = buf.get_u16_le();
15780 Ok(__struct)
15781 }
15782 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15783 let mut __tmp = BytesMut::new(bytes);
15784 #[allow(clippy::absurd_extreme_comparisons)]
15785 #[allow(unused_comparisons)]
15786 if __tmp.remaining() < Self::ENCODED_LEN {
15787 panic!(
15788 "buffer is too small (need {} bytes, but got {})",
15789 Self::ENCODED_LEN,
15790 __tmp.remaining(),
15791 )
15792 }
15793 __tmp.put_u64_le(self.time_usec);
15794 __tmp.put_i32_le(self.lat);
15795 __tmp.put_i32_le(self.lon);
15796 __tmp.put_i32_le(self.alt);
15797 __tmp.put_u16_le(self.eph);
15798 __tmp.put_u16_le(self.epv);
15799 __tmp.put_u16_le(self.vel);
15800 __tmp.put_i16_le(self.vn);
15801 __tmp.put_i16_le(self.ve);
15802 __tmp.put_i16_le(self.vd);
15803 __tmp.put_u16_le(self.cog);
15804 __tmp.put_u8(self.fix_type);
15805 __tmp.put_u8(self.satellites_visible);
15806 if matches!(version, MavlinkVersion::V2) {
15807 __tmp.put_u8(self.id);
15808 __tmp.put_u16_le(self.yaw);
15809 let len = __tmp.len();
15810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15811 } else {
15812 __tmp.len()
15813 }
15814 }
15815}
15816#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15817#[doc = ""]
15818#[doc = "ID: 114"]
15819#[derive(Debug, Clone, PartialEq)]
15820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15822pub struct HIL_OPTICAL_FLOW_DATA {
15823 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15824 pub time_usec: u64,
15825 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15826 pub integration_time_us: u32,
15827 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15828 pub integrated_x: f32,
15829 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15830 pub integrated_y: f32,
15831 #[doc = "RH rotation around X axis"]
15832 pub integrated_xgyro: f32,
15833 #[doc = "RH rotation around Y axis"]
15834 pub integrated_ygyro: f32,
15835 #[doc = "RH rotation around Z axis"]
15836 pub integrated_zgyro: f32,
15837 #[doc = "Time since the distance was sampled."]
15838 pub time_delta_distance_us: u32,
15839 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15840 pub distance: f32,
15841 #[doc = "Temperature"]
15842 pub temperature: i16,
15843 #[doc = "Sensor ID"]
15844 pub sensor_id: u8,
15845 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15846 pub quality: u8,
15847}
15848impl HIL_OPTICAL_FLOW_DATA {
15849 pub const ENCODED_LEN: usize = 44usize;
15850 pub const DEFAULT: Self = Self {
15851 time_usec: 0_u64,
15852 integration_time_us: 0_u32,
15853 integrated_x: 0.0_f32,
15854 integrated_y: 0.0_f32,
15855 integrated_xgyro: 0.0_f32,
15856 integrated_ygyro: 0.0_f32,
15857 integrated_zgyro: 0.0_f32,
15858 time_delta_distance_us: 0_u32,
15859 distance: 0.0_f32,
15860 temperature: 0_i16,
15861 sensor_id: 0_u8,
15862 quality: 0_u8,
15863 };
15864 #[cfg(feature = "arbitrary")]
15865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15866 use arbitrary::{Arbitrary, Unstructured};
15867 let mut buf = [0u8; 1024];
15868 rng.fill_bytes(&mut buf);
15869 let mut unstructured = Unstructured::new(&buf);
15870 Self::arbitrary(&mut unstructured).unwrap_or_default()
15871 }
15872}
15873impl Default for HIL_OPTICAL_FLOW_DATA {
15874 fn default() -> Self {
15875 Self::DEFAULT.clone()
15876 }
15877}
15878impl MessageData for HIL_OPTICAL_FLOW_DATA {
15879 type Message = MavMessage;
15880 const ID: u32 = 114u32;
15881 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15882 const EXTRA_CRC: u8 = 237u8;
15883 const ENCODED_LEN: usize = 44usize;
15884 fn deser(
15885 _version: MavlinkVersion,
15886 __input: &[u8],
15887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15888 let avail_len = __input.len();
15889 let mut payload_buf = [0; Self::ENCODED_LEN];
15890 let mut buf = if avail_len < Self::ENCODED_LEN {
15891 payload_buf[0..avail_len].copy_from_slice(__input);
15892 Bytes::new(&payload_buf)
15893 } else {
15894 Bytes::new(__input)
15895 };
15896 let mut __struct = Self::default();
15897 __struct.time_usec = buf.get_u64_le();
15898 __struct.integration_time_us = buf.get_u32_le();
15899 __struct.integrated_x = buf.get_f32_le();
15900 __struct.integrated_y = buf.get_f32_le();
15901 __struct.integrated_xgyro = buf.get_f32_le();
15902 __struct.integrated_ygyro = buf.get_f32_le();
15903 __struct.integrated_zgyro = buf.get_f32_le();
15904 __struct.time_delta_distance_us = buf.get_u32_le();
15905 __struct.distance = buf.get_f32_le();
15906 __struct.temperature = buf.get_i16_le();
15907 __struct.sensor_id = buf.get_u8();
15908 __struct.quality = buf.get_u8();
15909 Ok(__struct)
15910 }
15911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15912 let mut __tmp = BytesMut::new(bytes);
15913 #[allow(clippy::absurd_extreme_comparisons)]
15914 #[allow(unused_comparisons)]
15915 if __tmp.remaining() < Self::ENCODED_LEN {
15916 panic!(
15917 "buffer is too small (need {} bytes, but got {})",
15918 Self::ENCODED_LEN,
15919 __tmp.remaining(),
15920 )
15921 }
15922 __tmp.put_u64_le(self.time_usec);
15923 __tmp.put_u32_le(self.integration_time_us);
15924 __tmp.put_f32_le(self.integrated_x);
15925 __tmp.put_f32_le(self.integrated_y);
15926 __tmp.put_f32_le(self.integrated_xgyro);
15927 __tmp.put_f32_le(self.integrated_ygyro);
15928 __tmp.put_f32_le(self.integrated_zgyro);
15929 __tmp.put_u32_le(self.time_delta_distance_us);
15930 __tmp.put_f32_le(self.distance);
15931 __tmp.put_i16_le(self.temperature);
15932 __tmp.put_u8(self.sensor_id);
15933 __tmp.put_u8(self.quality);
15934 if matches!(version, MavlinkVersion::V2) {
15935 let len = __tmp.len();
15936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15937 } else {
15938 __tmp.len()
15939 }
15940 }
15941}
15942#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15943#[doc = ""]
15944#[doc = "ID: 92"]
15945#[derive(Debug, Clone, PartialEq)]
15946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15948pub struct HIL_RC_INPUTS_RAW_DATA {
15949 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15950 pub time_usec: u64,
15951 #[doc = "RC channel 1 value"]
15952 pub chan1_raw: u16,
15953 #[doc = "RC channel 2 value"]
15954 pub chan2_raw: u16,
15955 #[doc = "RC channel 3 value"]
15956 pub chan3_raw: u16,
15957 #[doc = "RC channel 4 value"]
15958 pub chan4_raw: u16,
15959 #[doc = "RC channel 5 value"]
15960 pub chan5_raw: u16,
15961 #[doc = "RC channel 6 value"]
15962 pub chan6_raw: u16,
15963 #[doc = "RC channel 7 value"]
15964 pub chan7_raw: u16,
15965 #[doc = "RC channel 8 value"]
15966 pub chan8_raw: u16,
15967 #[doc = "RC channel 9 value"]
15968 pub chan9_raw: u16,
15969 #[doc = "RC channel 10 value"]
15970 pub chan10_raw: u16,
15971 #[doc = "RC channel 11 value"]
15972 pub chan11_raw: u16,
15973 #[doc = "RC channel 12 value"]
15974 pub chan12_raw: u16,
15975 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
15976 pub rssi: u8,
15977}
15978impl HIL_RC_INPUTS_RAW_DATA {
15979 pub const ENCODED_LEN: usize = 33usize;
15980 pub const DEFAULT: Self = Self {
15981 time_usec: 0_u64,
15982 chan1_raw: 0_u16,
15983 chan2_raw: 0_u16,
15984 chan3_raw: 0_u16,
15985 chan4_raw: 0_u16,
15986 chan5_raw: 0_u16,
15987 chan6_raw: 0_u16,
15988 chan7_raw: 0_u16,
15989 chan8_raw: 0_u16,
15990 chan9_raw: 0_u16,
15991 chan10_raw: 0_u16,
15992 chan11_raw: 0_u16,
15993 chan12_raw: 0_u16,
15994 rssi: 0_u8,
15995 };
15996 #[cfg(feature = "arbitrary")]
15997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15998 use arbitrary::{Arbitrary, Unstructured};
15999 let mut buf = [0u8; 1024];
16000 rng.fill_bytes(&mut buf);
16001 let mut unstructured = Unstructured::new(&buf);
16002 Self::arbitrary(&mut unstructured).unwrap_or_default()
16003 }
16004}
16005impl Default for HIL_RC_INPUTS_RAW_DATA {
16006 fn default() -> Self {
16007 Self::DEFAULT.clone()
16008 }
16009}
16010impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16011 type Message = MavMessage;
16012 const ID: u32 = 92u32;
16013 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16014 const EXTRA_CRC: u8 = 54u8;
16015 const ENCODED_LEN: usize = 33usize;
16016 fn deser(
16017 _version: MavlinkVersion,
16018 __input: &[u8],
16019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16020 let avail_len = __input.len();
16021 let mut payload_buf = [0; Self::ENCODED_LEN];
16022 let mut buf = if avail_len < Self::ENCODED_LEN {
16023 payload_buf[0..avail_len].copy_from_slice(__input);
16024 Bytes::new(&payload_buf)
16025 } else {
16026 Bytes::new(__input)
16027 };
16028 let mut __struct = Self::default();
16029 __struct.time_usec = buf.get_u64_le();
16030 __struct.chan1_raw = buf.get_u16_le();
16031 __struct.chan2_raw = buf.get_u16_le();
16032 __struct.chan3_raw = buf.get_u16_le();
16033 __struct.chan4_raw = buf.get_u16_le();
16034 __struct.chan5_raw = buf.get_u16_le();
16035 __struct.chan6_raw = buf.get_u16_le();
16036 __struct.chan7_raw = buf.get_u16_le();
16037 __struct.chan8_raw = buf.get_u16_le();
16038 __struct.chan9_raw = buf.get_u16_le();
16039 __struct.chan10_raw = buf.get_u16_le();
16040 __struct.chan11_raw = buf.get_u16_le();
16041 __struct.chan12_raw = buf.get_u16_le();
16042 __struct.rssi = buf.get_u8();
16043 Ok(__struct)
16044 }
16045 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16046 let mut __tmp = BytesMut::new(bytes);
16047 #[allow(clippy::absurd_extreme_comparisons)]
16048 #[allow(unused_comparisons)]
16049 if __tmp.remaining() < Self::ENCODED_LEN {
16050 panic!(
16051 "buffer is too small (need {} bytes, but got {})",
16052 Self::ENCODED_LEN,
16053 __tmp.remaining(),
16054 )
16055 }
16056 __tmp.put_u64_le(self.time_usec);
16057 __tmp.put_u16_le(self.chan1_raw);
16058 __tmp.put_u16_le(self.chan2_raw);
16059 __tmp.put_u16_le(self.chan3_raw);
16060 __tmp.put_u16_le(self.chan4_raw);
16061 __tmp.put_u16_le(self.chan5_raw);
16062 __tmp.put_u16_le(self.chan6_raw);
16063 __tmp.put_u16_le(self.chan7_raw);
16064 __tmp.put_u16_le(self.chan8_raw);
16065 __tmp.put_u16_le(self.chan9_raw);
16066 __tmp.put_u16_le(self.chan10_raw);
16067 __tmp.put_u16_le(self.chan11_raw);
16068 __tmp.put_u16_le(self.chan12_raw);
16069 __tmp.put_u8(self.rssi);
16070 if matches!(version, MavlinkVersion::V2) {
16071 let len = __tmp.len();
16072 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16073 } else {
16074 __tmp.len()
16075 }
16076 }
16077}
16078#[doc = "The IMU readings in SI units in NED body frame."]
16079#[doc = ""]
16080#[doc = "ID: 107"]
16081#[derive(Debug, Clone, PartialEq)]
16082#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16083#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16084pub struct HIL_SENSOR_DATA {
16085 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16086 pub time_usec: u64,
16087 #[doc = "X acceleration"]
16088 pub xacc: f32,
16089 #[doc = "Y acceleration"]
16090 pub yacc: f32,
16091 #[doc = "Z acceleration"]
16092 pub zacc: f32,
16093 #[doc = "Angular speed around X axis in body frame"]
16094 pub xgyro: f32,
16095 #[doc = "Angular speed around Y axis in body frame"]
16096 pub ygyro: f32,
16097 #[doc = "Angular speed around Z axis in body frame"]
16098 pub zgyro: f32,
16099 #[doc = "X Magnetic field"]
16100 pub xmag: f32,
16101 #[doc = "Y Magnetic field"]
16102 pub ymag: f32,
16103 #[doc = "Z Magnetic field"]
16104 pub zmag: f32,
16105 #[doc = "Absolute pressure"]
16106 pub abs_pressure: f32,
16107 #[doc = "Differential pressure (airspeed)"]
16108 pub diff_pressure: f32,
16109 #[doc = "Altitude calculated from pressure"]
16110 pub pressure_alt: f32,
16111 #[doc = "Temperature"]
16112 pub temperature: f32,
16113 #[doc = "Bitmap for fields that have updated since last message"]
16114 pub fields_updated: HilSensorUpdatedFlags,
16115 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16116 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16117 pub id: u8,
16118}
16119impl HIL_SENSOR_DATA {
16120 pub const ENCODED_LEN: usize = 65usize;
16121 pub const DEFAULT: Self = Self {
16122 time_usec: 0_u64,
16123 xacc: 0.0_f32,
16124 yacc: 0.0_f32,
16125 zacc: 0.0_f32,
16126 xgyro: 0.0_f32,
16127 ygyro: 0.0_f32,
16128 zgyro: 0.0_f32,
16129 xmag: 0.0_f32,
16130 ymag: 0.0_f32,
16131 zmag: 0.0_f32,
16132 abs_pressure: 0.0_f32,
16133 diff_pressure: 0.0_f32,
16134 pressure_alt: 0.0_f32,
16135 temperature: 0.0_f32,
16136 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16137 id: 0_u8,
16138 };
16139 #[cfg(feature = "arbitrary")]
16140 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16141 use arbitrary::{Arbitrary, Unstructured};
16142 let mut buf = [0u8; 1024];
16143 rng.fill_bytes(&mut buf);
16144 let mut unstructured = Unstructured::new(&buf);
16145 Self::arbitrary(&mut unstructured).unwrap_or_default()
16146 }
16147}
16148impl Default for HIL_SENSOR_DATA {
16149 fn default() -> Self {
16150 Self::DEFAULT.clone()
16151 }
16152}
16153impl MessageData for HIL_SENSOR_DATA {
16154 type Message = MavMessage;
16155 const ID: u32 = 107u32;
16156 const NAME: &'static str = "HIL_SENSOR";
16157 const EXTRA_CRC: u8 = 108u8;
16158 const ENCODED_LEN: usize = 65usize;
16159 fn deser(
16160 _version: MavlinkVersion,
16161 __input: &[u8],
16162 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16163 let avail_len = __input.len();
16164 let mut payload_buf = [0; Self::ENCODED_LEN];
16165 let mut buf = if avail_len < Self::ENCODED_LEN {
16166 payload_buf[0..avail_len].copy_from_slice(__input);
16167 Bytes::new(&payload_buf)
16168 } else {
16169 Bytes::new(__input)
16170 };
16171 let mut __struct = Self::default();
16172 __struct.time_usec = buf.get_u64_le();
16173 __struct.xacc = buf.get_f32_le();
16174 __struct.yacc = buf.get_f32_le();
16175 __struct.zacc = buf.get_f32_le();
16176 __struct.xgyro = buf.get_f32_le();
16177 __struct.ygyro = buf.get_f32_le();
16178 __struct.zgyro = buf.get_f32_le();
16179 __struct.xmag = buf.get_f32_le();
16180 __struct.ymag = buf.get_f32_le();
16181 __struct.zmag = buf.get_f32_le();
16182 __struct.abs_pressure = buf.get_f32_le();
16183 __struct.diff_pressure = buf.get_f32_le();
16184 __struct.pressure_alt = buf.get_f32_le();
16185 __struct.temperature = buf.get_f32_le();
16186 let tmp = buf.get_u32_le();
16187 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16188 tmp & HilSensorUpdatedFlags::all().bits(),
16189 )
16190 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16191 flag_type: "HilSensorUpdatedFlags",
16192 value: tmp as u32,
16193 })?;
16194 __struct.id = buf.get_u8();
16195 Ok(__struct)
16196 }
16197 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16198 let mut __tmp = BytesMut::new(bytes);
16199 #[allow(clippy::absurd_extreme_comparisons)]
16200 #[allow(unused_comparisons)]
16201 if __tmp.remaining() < Self::ENCODED_LEN {
16202 panic!(
16203 "buffer is too small (need {} bytes, but got {})",
16204 Self::ENCODED_LEN,
16205 __tmp.remaining(),
16206 )
16207 }
16208 __tmp.put_u64_le(self.time_usec);
16209 __tmp.put_f32_le(self.xacc);
16210 __tmp.put_f32_le(self.yacc);
16211 __tmp.put_f32_le(self.zacc);
16212 __tmp.put_f32_le(self.xgyro);
16213 __tmp.put_f32_le(self.ygyro);
16214 __tmp.put_f32_le(self.zgyro);
16215 __tmp.put_f32_le(self.xmag);
16216 __tmp.put_f32_le(self.ymag);
16217 __tmp.put_f32_le(self.zmag);
16218 __tmp.put_f32_le(self.abs_pressure);
16219 __tmp.put_f32_le(self.diff_pressure);
16220 __tmp.put_f32_le(self.pressure_alt);
16221 __tmp.put_f32_le(self.temperature);
16222 __tmp.put_u32_le(self.fields_updated.bits());
16223 if matches!(version, MavlinkVersion::V2) {
16224 __tmp.put_u8(self.id);
16225 let len = __tmp.len();
16226 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16227 } else {
16228 __tmp.len()
16229 }
16230 }
16231}
16232#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16233#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16234#[doc = ""]
16235#[doc = "ID: 90"]
16236#[derive(Debug, Clone, PartialEq)]
16237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16239pub struct HIL_STATE_DATA {
16240 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16241 pub time_usec: u64,
16242 #[doc = "Roll angle"]
16243 pub roll: f32,
16244 #[doc = "Pitch angle"]
16245 pub pitch: f32,
16246 #[doc = "Yaw angle"]
16247 pub yaw: f32,
16248 #[doc = "Body frame roll / phi angular speed"]
16249 pub rollspeed: f32,
16250 #[doc = "Body frame pitch / theta angular speed"]
16251 pub pitchspeed: f32,
16252 #[doc = "Body frame yaw / psi angular speed"]
16253 pub yawspeed: f32,
16254 #[doc = "Latitude"]
16255 pub lat: i32,
16256 #[doc = "Longitude"]
16257 pub lon: i32,
16258 #[doc = "Altitude"]
16259 pub alt: i32,
16260 #[doc = "Ground X Speed (Latitude)"]
16261 pub vx: i16,
16262 #[doc = "Ground Y Speed (Longitude)"]
16263 pub vy: i16,
16264 #[doc = "Ground Z Speed (Altitude)"]
16265 pub vz: i16,
16266 #[doc = "X acceleration"]
16267 pub xacc: i16,
16268 #[doc = "Y acceleration"]
16269 pub yacc: i16,
16270 #[doc = "Z acceleration"]
16271 pub zacc: i16,
16272}
16273impl HIL_STATE_DATA {
16274 pub const ENCODED_LEN: usize = 56usize;
16275 pub const DEFAULT: Self = Self {
16276 time_usec: 0_u64,
16277 roll: 0.0_f32,
16278 pitch: 0.0_f32,
16279 yaw: 0.0_f32,
16280 rollspeed: 0.0_f32,
16281 pitchspeed: 0.0_f32,
16282 yawspeed: 0.0_f32,
16283 lat: 0_i32,
16284 lon: 0_i32,
16285 alt: 0_i32,
16286 vx: 0_i16,
16287 vy: 0_i16,
16288 vz: 0_i16,
16289 xacc: 0_i16,
16290 yacc: 0_i16,
16291 zacc: 0_i16,
16292 };
16293 #[cfg(feature = "arbitrary")]
16294 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16295 use arbitrary::{Arbitrary, Unstructured};
16296 let mut buf = [0u8; 1024];
16297 rng.fill_bytes(&mut buf);
16298 let mut unstructured = Unstructured::new(&buf);
16299 Self::arbitrary(&mut unstructured).unwrap_or_default()
16300 }
16301}
16302impl Default for HIL_STATE_DATA {
16303 fn default() -> Self {
16304 Self::DEFAULT.clone()
16305 }
16306}
16307impl MessageData for HIL_STATE_DATA {
16308 type Message = MavMessage;
16309 const ID: u32 = 90u32;
16310 const NAME: &'static str = "HIL_STATE";
16311 const EXTRA_CRC: u8 = 183u8;
16312 const ENCODED_LEN: usize = 56usize;
16313 fn deser(
16314 _version: MavlinkVersion,
16315 __input: &[u8],
16316 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16317 let avail_len = __input.len();
16318 let mut payload_buf = [0; Self::ENCODED_LEN];
16319 let mut buf = if avail_len < Self::ENCODED_LEN {
16320 payload_buf[0..avail_len].copy_from_slice(__input);
16321 Bytes::new(&payload_buf)
16322 } else {
16323 Bytes::new(__input)
16324 };
16325 let mut __struct = Self::default();
16326 __struct.time_usec = buf.get_u64_le();
16327 __struct.roll = buf.get_f32_le();
16328 __struct.pitch = buf.get_f32_le();
16329 __struct.yaw = buf.get_f32_le();
16330 __struct.rollspeed = buf.get_f32_le();
16331 __struct.pitchspeed = buf.get_f32_le();
16332 __struct.yawspeed = buf.get_f32_le();
16333 __struct.lat = buf.get_i32_le();
16334 __struct.lon = buf.get_i32_le();
16335 __struct.alt = buf.get_i32_le();
16336 __struct.vx = buf.get_i16_le();
16337 __struct.vy = buf.get_i16_le();
16338 __struct.vz = buf.get_i16_le();
16339 __struct.xacc = buf.get_i16_le();
16340 __struct.yacc = buf.get_i16_le();
16341 __struct.zacc = buf.get_i16_le();
16342 Ok(__struct)
16343 }
16344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16345 let mut __tmp = BytesMut::new(bytes);
16346 #[allow(clippy::absurd_extreme_comparisons)]
16347 #[allow(unused_comparisons)]
16348 if __tmp.remaining() < Self::ENCODED_LEN {
16349 panic!(
16350 "buffer is too small (need {} bytes, but got {})",
16351 Self::ENCODED_LEN,
16352 __tmp.remaining(),
16353 )
16354 }
16355 __tmp.put_u64_le(self.time_usec);
16356 __tmp.put_f32_le(self.roll);
16357 __tmp.put_f32_le(self.pitch);
16358 __tmp.put_f32_le(self.yaw);
16359 __tmp.put_f32_le(self.rollspeed);
16360 __tmp.put_f32_le(self.pitchspeed);
16361 __tmp.put_f32_le(self.yawspeed);
16362 __tmp.put_i32_le(self.lat);
16363 __tmp.put_i32_le(self.lon);
16364 __tmp.put_i32_le(self.alt);
16365 __tmp.put_i16_le(self.vx);
16366 __tmp.put_i16_le(self.vy);
16367 __tmp.put_i16_le(self.vz);
16368 __tmp.put_i16_le(self.xacc);
16369 __tmp.put_i16_le(self.yacc);
16370 __tmp.put_i16_le(self.zacc);
16371 if matches!(version, MavlinkVersion::V2) {
16372 let len = __tmp.len();
16373 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16374 } else {
16375 __tmp.len()
16376 }
16377 }
16378}
16379#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16380#[doc = ""]
16381#[doc = "ID: 115"]
16382#[derive(Debug, Clone, PartialEq)]
16383#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16385pub struct HIL_STATE_QUATERNION_DATA {
16386 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16387 pub time_usec: u64,
16388 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16389 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16390 pub attitude_quaternion: [f32; 4],
16391 #[doc = "Body frame roll / phi angular speed"]
16392 pub rollspeed: f32,
16393 #[doc = "Body frame pitch / theta angular speed"]
16394 pub pitchspeed: f32,
16395 #[doc = "Body frame yaw / psi angular speed"]
16396 pub yawspeed: f32,
16397 #[doc = "Latitude"]
16398 pub lat: i32,
16399 #[doc = "Longitude"]
16400 pub lon: i32,
16401 #[doc = "Altitude"]
16402 pub alt: i32,
16403 #[doc = "Ground X Speed (Latitude)"]
16404 pub vx: i16,
16405 #[doc = "Ground Y Speed (Longitude)"]
16406 pub vy: i16,
16407 #[doc = "Ground Z Speed (Altitude)"]
16408 pub vz: i16,
16409 #[doc = "Indicated airspeed"]
16410 pub ind_airspeed: u16,
16411 #[doc = "True airspeed"]
16412 pub true_airspeed: u16,
16413 #[doc = "X acceleration"]
16414 pub xacc: i16,
16415 #[doc = "Y acceleration"]
16416 pub yacc: i16,
16417 #[doc = "Z acceleration"]
16418 pub zacc: i16,
16419}
16420impl HIL_STATE_QUATERNION_DATA {
16421 pub const ENCODED_LEN: usize = 64usize;
16422 pub const DEFAULT: Self = Self {
16423 time_usec: 0_u64,
16424 attitude_quaternion: [0.0_f32; 4usize],
16425 rollspeed: 0.0_f32,
16426 pitchspeed: 0.0_f32,
16427 yawspeed: 0.0_f32,
16428 lat: 0_i32,
16429 lon: 0_i32,
16430 alt: 0_i32,
16431 vx: 0_i16,
16432 vy: 0_i16,
16433 vz: 0_i16,
16434 ind_airspeed: 0_u16,
16435 true_airspeed: 0_u16,
16436 xacc: 0_i16,
16437 yacc: 0_i16,
16438 zacc: 0_i16,
16439 };
16440 #[cfg(feature = "arbitrary")]
16441 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16442 use arbitrary::{Arbitrary, Unstructured};
16443 let mut buf = [0u8; 1024];
16444 rng.fill_bytes(&mut buf);
16445 let mut unstructured = Unstructured::new(&buf);
16446 Self::arbitrary(&mut unstructured).unwrap_or_default()
16447 }
16448}
16449impl Default for HIL_STATE_QUATERNION_DATA {
16450 fn default() -> Self {
16451 Self::DEFAULT.clone()
16452 }
16453}
16454impl MessageData for HIL_STATE_QUATERNION_DATA {
16455 type Message = MavMessage;
16456 const ID: u32 = 115u32;
16457 const NAME: &'static str = "HIL_STATE_QUATERNION";
16458 const EXTRA_CRC: u8 = 4u8;
16459 const ENCODED_LEN: usize = 64usize;
16460 fn deser(
16461 _version: MavlinkVersion,
16462 __input: &[u8],
16463 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16464 let avail_len = __input.len();
16465 let mut payload_buf = [0; Self::ENCODED_LEN];
16466 let mut buf = if avail_len < Self::ENCODED_LEN {
16467 payload_buf[0..avail_len].copy_from_slice(__input);
16468 Bytes::new(&payload_buf)
16469 } else {
16470 Bytes::new(__input)
16471 };
16472 let mut __struct = Self::default();
16473 __struct.time_usec = buf.get_u64_le();
16474 for v in &mut __struct.attitude_quaternion {
16475 let val = buf.get_f32_le();
16476 *v = val;
16477 }
16478 __struct.rollspeed = buf.get_f32_le();
16479 __struct.pitchspeed = buf.get_f32_le();
16480 __struct.yawspeed = buf.get_f32_le();
16481 __struct.lat = buf.get_i32_le();
16482 __struct.lon = buf.get_i32_le();
16483 __struct.alt = buf.get_i32_le();
16484 __struct.vx = buf.get_i16_le();
16485 __struct.vy = buf.get_i16_le();
16486 __struct.vz = buf.get_i16_le();
16487 __struct.ind_airspeed = buf.get_u16_le();
16488 __struct.true_airspeed = buf.get_u16_le();
16489 __struct.xacc = buf.get_i16_le();
16490 __struct.yacc = buf.get_i16_le();
16491 __struct.zacc = buf.get_i16_le();
16492 Ok(__struct)
16493 }
16494 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16495 let mut __tmp = BytesMut::new(bytes);
16496 #[allow(clippy::absurd_extreme_comparisons)]
16497 #[allow(unused_comparisons)]
16498 if __tmp.remaining() < Self::ENCODED_LEN {
16499 panic!(
16500 "buffer is too small (need {} bytes, but got {})",
16501 Self::ENCODED_LEN,
16502 __tmp.remaining(),
16503 )
16504 }
16505 __tmp.put_u64_le(self.time_usec);
16506 for val in &self.attitude_quaternion {
16507 __tmp.put_f32_le(*val);
16508 }
16509 __tmp.put_f32_le(self.rollspeed);
16510 __tmp.put_f32_le(self.pitchspeed);
16511 __tmp.put_f32_le(self.yawspeed);
16512 __tmp.put_i32_le(self.lat);
16513 __tmp.put_i32_le(self.lon);
16514 __tmp.put_i32_le(self.alt);
16515 __tmp.put_i16_le(self.vx);
16516 __tmp.put_i16_le(self.vy);
16517 __tmp.put_i16_le(self.vz);
16518 __tmp.put_u16_le(self.ind_airspeed);
16519 __tmp.put_u16_le(self.true_airspeed);
16520 __tmp.put_i16_le(self.xacc);
16521 __tmp.put_i16_le(self.yacc);
16522 __tmp.put_i16_le(self.zacc);
16523 if matches!(version, MavlinkVersion::V2) {
16524 let len = __tmp.len();
16525 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16526 } else {
16527 __tmp.len()
16528 }
16529 }
16530}
16531#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16532#[doc = ""]
16533#[doc = "ID: 242"]
16534#[derive(Debug, Clone, PartialEq)]
16535#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16536#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16537pub struct HOME_POSITION_DATA {
16538 #[doc = "Latitude (WGS84)"]
16539 pub latitude: i32,
16540 #[doc = "Longitude (WGS84)"]
16541 pub longitude: i32,
16542 #[doc = "Altitude (MSL). Positive for up."]
16543 pub altitude: i32,
16544 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16545 pub x: f32,
16546 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16547 pub y: f32,
16548 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16549 pub z: f32,
16550 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16551 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16552 pub q: [f32; 4],
16553 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16554 pub approach_x: f32,
16555 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16556 pub approach_y: f32,
16557 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16558 pub approach_z: f32,
16559 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16560 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16561 pub time_usec: u64,
16562}
16563impl HOME_POSITION_DATA {
16564 pub const ENCODED_LEN: usize = 60usize;
16565 pub const DEFAULT: Self = Self {
16566 latitude: 0_i32,
16567 longitude: 0_i32,
16568 altitude: 0_i32,
16569 x: 0.0_f32,
16570 y: 0.0_f32,
16571 z: 0.0_f32,
16572 q: [0.0_f32; 4usize],
16573 approach_x: 0.0_f32,
16574 approach_y: 0.0_f32,
16575 approach_z: 0.0_f32,
16576 time_usec: 0_u64,
16577 };
16578 #[cfg(feature = "arbitrary")]
16579 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16580 use arbitrary::{Arbitrary, Unstructured};
16581 let mut buf = [0u8; 1024];
16582 rng.fill_bytes(&mut buf);
16583 let mut unstructured = Unstructured::new(&buf);
16584 Self::arbitrary(&mut unstructured).unwrap_or_default()
16585 }
16586}
16587impl Default for HOME_POSITION_DATA {
16588 fn default() -> Self {
16589 Self::DEFAULT.clone()
16590 }
16591}
16592impl MessageData for HOME_POSITION_DATA {
16593 type Message = MavMessage;
16594 const ID: u32 = 242u32;
16595 const NAME: &'static str = "HOME_POSITION";
16596 const EXTRA_CRC: u8 = 104u8;
16597 const ENCODED_LEN: usize = 60usize;
16598 fn deser(
16599 _version: MavlinkVersion,
16600 __input: &[u8],
16601 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16602 let avail_len = __input.len();
16603 let mut payload_buf = [0; Self::ENCODED_LEN];
16604 let mut buf = if avail_len < Self::ENCODED_LEN {
16605 payload_buf[0..avail_len].copy_from_slice(__input);
16606 Bytes::new(&payload_buf)
16607 } else {
16608 Bytes::new(__input)
16609 };
16610 let mut __struct = Self::default();
16611 __struct.latitude = buf.get_i32_le();
16612 __struct.longitude = buf.get_i32_le();
16613 __struct.altitude = buf.get_i32_le();
16614 __struct.x = buf.get_f32_le();
16615 __struct.y = buf.get_f32_le();
16616 __struct.z = buf.get_f32_le();
16617 for v in &mut __struct.q {
16618 let val = buf.get_f32_le();
16619 *v = val;
16620 }
16621 __struct.approach_x = buf.get_f32_le();
16622 __struct.approach_y = buf.get_f32_le();
16623 __struct.approach_z = buf.get_f32_le();
16624 __struct.time_usec = buf.get_u64_le();
16625 Ok(__struct)
16626 }
16627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16628 let mut __tmp = BytesMut::new(bytes);
16629 #[allow(clippy::absurd_extreme_comparisons)]
16630 #[allow(unused_comparisons)]
16631 if __tmp.remaining() < Self::ENCODED_LEN {
16632 panic!(
16633 "buffer is too small (need {} bytes, but got {})",
16634 Self::ENCODED_LEN,
16635 __tmp.remaining(),
16636 )
16637 }
16638 __tmp.put_i32_le(self.latitude);
16639 __tmp.put_i32_le(self.longitude);
16640 __tmp.put_i32_le(self.altitude);
16641 __tmp.put_f32_le(self.x);
16642 __tmp.put_f32_le(self.y);
16643 __tmp.put_f32_le(self.z);
16644 for val in &self.q {
16645 __tmp.put_f32_le(*val);
16646 }
16647 __tmp.put_f32_le(self.approach_x);
16648 __tmp.put_f32_le(self.approach_y);
16649 __tmp.put_f32_le(self.approach_z);
16650 if matches!(version, MavlinkVersion::V2) {
16651 __tmp.put_u64_le(self.time_usec);
16652 let len = __tmp.len();
16653 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16654 } else {
16655 __tmp.len()
16656 }
16657 }
16658}
16659#[doc = "Temperature and humidity from hygrometer."]
16660#[doc = ""]
16661#[doc = "ID: 12920"]
16662#[derive(Debug, Clone, PartialEq)]
16663#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16665pub struct HYGROMETER_SENSOR_DATA {
16666 #[doc = "Temperature"]
16667 pub temperature: i16,
16668 #[doc = "Humidity"]
16669 pub humidity: u16,
16670 #[doc = "Hygrometer ID"]
16671 pub id: u8,
16672}
16673impl HYGROMETER_SENSOR_DATA {
16674 pub const ENCODED_LEN: usize = 5usize;
16675 pub const DEFAULT: Self = Self {
16676 temperature: 0_i16,
16677 humidity: 0_u16,
16678 id: 0_u8,
16679 };
16680 #[cfg(feature = "arbitrary")]
16681 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16682 use arbitrary::{Arbitrary, Unstructured};
16683 let mut buf = [0u8; 1024];
16684 rng.fill_bytes(&mut buf);
16685 let mut unstructured = Unstructured::new(&buf);
16686 Self::arbitrary(&mut unstructured).unwrap_or_default()
16687 }
16688}
16689impl Default for HYGROMETER_SENSOR_DATA {
16690 fn default() -> Self {
16691 Self::DEFAULT.clone()
16692 }
16693}
16694impl MessageData for HYGROMETER_SENSOR_DATA {
16695 type Message = MavMessage;
16696 const ID: u32 = 12920u32;
16697 const NAME: &'static str = "HYGROMETER_SENSOR";
16698 const EXTRA_CRC: u8 = 20u8;
16699 const ENCODED_LEN: usize = 5usize;
16700 fn deser(
16701 _version: MavlinkVersion,
16702 __input: &[u8],
16703 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16704 let avail_len = __input.len();
16705 let mut payload_buf = [0; Self::ENCODED_LEN];
16706 let mut buf = if avail_len < Self::ENCODED_LEN {
16707 payload_buf[0..avail_len].copy_from_slice(__input);
16708 Bytes::new(&payload_buf)
16709 } else {
16710 Bytes::new(__input)
16711 };
16712 let mut __struct = Self::default();
16713 __struct.temperature = buf.get_i16_le();
16714 __struct.humidity = buf.get_u16_le();
16715 __struct.id = buf.get_u8();
16716 Ok(__struct)
16717 }
16718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16719 let mut __tmp = BytesMut::new(bytes);
16720 #[allow(clippy::absurd_extreme_comparisons)]
16721 #[allow(unused_comparisons)]
16722 if __tmp.remaining() < Self::ENCODED_LEN {
16723 panic!(
16724 "buffer is too small (need {} bytes, but got {})",
16725 Self::ENCODED_LEN,
16726 __tmp.remaining(),
16727 )
16728 }
16729 __tmp.put_i16_le(self.temperature);
16730 __tmp.put_u16_le(self.humidity);
16731 __tmp.put_u8(self.id);
16732 if matches!(version, MavlinkVersion::V2) {
16733 let len = __tmp.len();
16734 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16735 } else {
16736 __tmp.len()
16737 }
16738 }
16739}
16740#[doc = "Illuminator status."]
16741#[doc = ""]
16742#[doc = "ID: 440"]
16743#[derive(Debug, Clone, PartialEq)]
16744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16746pub struct ILLUMINATOR_STATUS_DATA {
16747 #[doc = "Time since the start-up of the illuminator in ms"]
16748 pub uptime_ms: u32,
16749 #[doc = "Errors"]
16750 pub error_status: IlluminatorErrorFlags,
16751 #[doc = "Illuminator brightness"]
16752 pub brightness: f32,
16753 #[doc = "Illuminator strobing period in seconds"]
16754 pub strobe_period: f32,
16755 #[doc = "Illuminator strobing duty cycle"]
16756 pub strobe_duty_cycle: f32,
16757 #[doc = "Temperature in Celsius"]
16758 pub temp_c: f32,
16759 #[doc = "Minimum strobing period in seconds"]
16760 pub min_strobe_period: f32,
16761 #[doc = "Maximum strobing period in seconds"]
16762 pub max_strobe_period: f32,
16763 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16764 pub enable: u8,
16765 #[doc = "Supported illuminator modes"]
16766 pub mode_bitmask: IlluminatorMode,
16767 #[doc = "Illuminator mode"]
16768 pub mode: IlluminatorMode,
16769}
16770impl ILLUMINATOR_STATUS_DATA {
16771 pub const ENCODED_LEN: usize = 35usize;
16772 pub const DEFAULT: Self = Self {
16773 uptime_ms: 0_u32,
16774 error_status: IlluminatorErrorFlags::DEFAULT,
16775 brightness: 0.0_f32,
16776 strobe_period: 0.0_f32,
16777 strobe_duty_cycle: 0.0_f32,
16778 temp_c: 0.0_f32,
16779 min_strobe_period: 0.0_f32,
16780 max_strobe_period: 0.0_f32,
16781 enable: 0_u8,
16782 mode_bitmask: IlluminatorMode::DEFAULT,
16783 mode: IlluminatorMode::DEFAULT,
16784 };
16785 #[cfg(feature = "arbitrary")]
16786 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16787 use arbitrary::{Arbitrary, Unstructured};
16788 let mut buf = [0u8; 1024];
16789 rng.fill_bytes(&mut buf);
16790 let mut unstructured = Unstructured::new(&buf);
16791 Self::arbitrary(&mut unstructured).unwrap_or_default()
16792 }
16793}
16794impl Default for ILLUMINATOR_STATUS_DATA {
16795 fn default() -> Self {
16796 Self::DEFAULT.clone()
16797 }
16798}
16799impl MessageData for ILLUMINATOR_STATUS_DATA {
16800 type Message = MavMessage;
16801 const ID: u32 = 440u32;
16802 const NAME: &'static str = "ILLUMINATOR_STATUS";
16803 const EXTRA_CRC: u8 = 66u8;
16804 const ENCODED_LEN: usize = 35usize;
16805 fn deser(
16806 _version: MavlinkVersion,
16807 __input: &[u8],
16808 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16809 let avail_len = __input.len();
16810 let mut payload_buf = [0; Self::ENCODED_LEN];
16811 let mut buf = if avail_len < Self::ENCODED_LEN {
16812 payload_buf[0..avail_len].copy_from_slice(__input);
16813 Bytes::new(&payload_buf)
16814 } else {
16815 Bytes::new(__input)
16816 };
16817 let mut __struct = Self::default();
16818 __struct.uptime_ms = buf.get_u32_le();
16819 let tmp = buf.get_u32_le();
16820 __struct.error_status = IlluminatorErrorFlags::from_bits(
16821 tmp & IlluminatorErrorFlags::all().bits(),
16822 )
16823 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16824 flag_type: "IlluminatorErrorFlags",
16825 value: tmp as u32,
16826 })?;
16827 __struct.brightness = buf.get_f32_le();
16828 __struct.strobe_period = buf.get_f32_le();
16829 __struct.strobe_duty_cycle = buf.get_f32_le();
16830 __struct.temp_c = buf.get_f32_le();
16831 __struct.min_strobe_period = buf.get_f32_le();
16832 __struct.max_strobe_period = buf.get_f32_le();
16833 __struct.enable = buf.get_u8();
16834 let tmp = buf.get_u8();
16835 __struct.mode_bitmask =
16836 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16837 enum_type: "IlluminatorMode",
16838 value: tmp as u32,
16839 })?;
16840 let tmp = buf.get_u8();
16841 __struct.mode =
16842 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16843 enum_type: "IlluminatorMode",
16844 value: tmp as u32,
16845 })?;
16846 Ok(__struct)
16847 }
16848 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16849 let mut __tmp = BytesMut::new(bytes);
16850 #[allow(clippy::absurd_extreme_comparisons)]
16851 #[allow(unused_comparisons)]
16852 if __tmp.remaining() < Self::ENCODED_LEN {
16853 panic!(
16854 "buffer is too small (need {} bytes, but got {})",
16855 Self::ENCODED_LEN,
16856 __tmp.remaining(),
16857 )
16858 }
16859 __tmp.put_u32_le(self.uptime_ms);
16860 __tmp.put_u32_le(self.error_status.bits());
16861 __tmp.put_f32_le(self.brightness);
16862 __tmp.put_f32_le(self.strobe_period);
16863 __tmp.put_f32_le(self.strobe_duty_cycle);
16864 __tmp.put_f32_le(self.temp_c);
16865 __tmp.put_f32_le(self.min_strobe_period);
16866 __tmp.put_f32_le(self.max_strobe_period);
16867 __tmp.put_u8(self.enable);
16868 __tmp.put_u8(self.mode_bitmask as u8);
16869 __tmp.put_u8(self.mode as u8);
16870 if matches!(version, MavlinkVersion::V2) {
16871 let len = __tmp.len();
16872 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16873 } else {
16874 __tmp.len()
16875 }
16876 }
16877}
16878#[doc = "Status of the Iridium SBD link."]
16879#[doc = ""]
16880#[doc = "ID: 335"]
16881#[derive(Debug, Clone, PartialEq)]
16882#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16883#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16884pub struct ISBD_LINK_STATUS_DATA {
16885 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16886 pub timestamp: u64,
16887 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16888 pub last_heartbeat: u64,
16889 #[doc = "Number of failed SBD sessions."]
16890 pub failed_sessions: u16,
16891 #[doc = "Number of successful SBD sessions."]
16892 pub successful_sessions: u16,
16893 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16894 pub signal_quality: u8,
16895 #[doc = "1: Ring call pending, 0: No call pending."]
16896 pub ring_pending: u8,
16897 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16898 pub tx_session_pending: u8,
16899 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16900 pub rx_session_pending: u8,
16901}
16902impl ISBD_LINK_STATUS_DATA {
16903 pub const ENCODED_LEN: usize = 24usize;
16904 pub const DEFAULT: Self = Self {
16905 timestamp: 0_u64,
16906 last_heartbeat: 0_u64,
16907 failed_sessions: 0_u16,
16908 successful_sessions: 0_u16,
16909 signal_quality: 0_u8,
16910 ring_pending: 0_u8,
16911 tx_session_pending: 0_u8,
16912 rx_session_pending: 0_u8,
16913 };
16914 #[cfg(feature = "arbitrary")]
16915 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16916 use arbitrary::{Arbitrary, Unstructured};
16917 let mut buf = [0u8; 1024];
16918 rng.fill_bytes(&mut buf);
16919 let mut unstructured = Unstructured::new(&buf);
16920 Self::arbitrary(&mut unstructured).unwrap_or_default()
16921 }
16922}
16923impl Default for ISBD_LINK_STATUS_DATA {
16924 fn default() -> Self {
16925 Self::DEFAULT.clone()
16926 }
16927}
16928impl MessageData for ISBD_LINK_STATUS_DATA {
16929 type Message = MavMessage;
16930 const ID: u32 = 335u32;
16931 const NAME: &'static str = "ISBD_LINK_STATUS";
16932 const EXTRA_CRC: u8 = 225u8;
16933 const ENCODED_LEN: usize = 24usize;
16934 fn deser(
16935 _version: MavlinkVersion,
16936 __input: &[u8],
16937 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16938 let avail_len = __input.len();
16939 let mut payload_buf = [0; Self::ENCODED_LEN];
16940 let mut buf = if avail_len < Self::ENCODED_LEN {
16941 payload_buf[0..avail_len].copy_from_slice(__input);
16942 Bytes::new(&payload_buf)
16943 } else {
16944 Bytes::new(__input)
16945 };
16946 let mut __struct = Self::default();
16947 __struct.timestamp = buf.get_u64_le();
16948 __struct.last_heartbeat = buf.get_u64_le();
16949 __struct.failed_sessions = buf.get_u16_le();
16950 __struct.successful_sessions = buf.get_u16_le();
16951 __struct.signal_quality = buf.get_u8();
16952 __struct.ring_pending = buf.get_u8();
16953 __struct.tx_session_pending = buf.get_u8();
16954 __struct.rx_session_pending = buf.get_u8();
16955 Ok(__struct)
16956 }
16957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16958 let mut __tmp = BytesMut::new(bytes);
16959 #[allow(clippy::absurd_extreme_comparisons)]
16960 #[allow(unused_comparisons)]
16961 if __tmp.remaining() < Self::ENCODED_LEN {
16962 panic!(
16963 "buffer is too small (need {} bytes, but got {})",
16964 Self::ENCODED_LEN,
16965 __tmp.remaining(),
16966 )
16967 }
16968 __tmp.put_u64_le(self.timestamp);
16969 __tmp.put_u64_le(self.last_heartbeat);
16970 __tmp.put_u16_le(self.failed_sessions);
16971 __tmp.put_u16_le(self.successful_sessions);
16972 __tmp.put_u8(self.signal_quality);
16973 __tmp.put_u8(self.ring_pending);
16974 __tmp.put_u8(self.tx_session_pending);
16975 __tmp.put_u8(self.rx_session_pending);
16976 if matches!(version, MavlinkVersion::V2) {
16977 let len = __tmp.len();
16978 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16979 } else {
16980 __tmp.len()
16981 }
16982 }
16983}
16984#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
16985#[doc = ""]
16986#[doc = "ID: 149"]
16987#[derive(Debug, Clone, PartialEq)]
16988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16990pub struct LANDING_TARGET_DATA {
16991 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16992 pub time_usec: u64,
16993 #[doc = "X-axis angular offset of the target from the center of the image"]
16994 pub angle_x: f32,
16995 #[doc = "Y-axis angular offset of the target from the center of the image"]
16996 pub angle_y: f32,
16997 #[doc = "Distance to the target from the vehicle"]
16998 pub distance: f32,
16999 #[doc = "Size of target along x-axis"]
17000 pub size_x: f32,
17001 #[doc = "Size of target along y-axis"]
17002 pub size_y: f32,
17003 #[doc = "The ID of the target if multiple targets are present"]
17004 pub target_num: u8,
17005 #[doc = "Coordinate frame used for following fields."]
17006 pub frame: MavFrame,
17007 #[doc = "X Position of the landing target in MAV_FRAME"]
17008 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17009 pub x: f32,
17010 #[doc = "Y Position of the landing target in MAV_FRAME"]
17011 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17012 pub y: f32,
17013 #[doc = "Z Position of the landing target in MAV_FRAME"]
17014 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17015 pub z: f32,
17016 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17017 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17019 pub q: [f32; 4],
17020 #[doc = "Type of landing target"]
17021 #[cfg_attr(feature = "serde", serde(default))]
17022 pub mavtype: LandingTargetType,
17023 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17024 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17025 pub position_valid: u8,
17026}
17027impl LANDING_TARGET_DATA {
17028 pub const ENCODED_LEN: usize = 60usize;
17029 pub const DEFAULT: Self = Self {
17030 time_usec: 0_u64,
17031 angle_x: 0.0_f32,
17032 angle_y: 0.0_f32,
17033 distance: 0.0_f32,
17034 size_x: 0.0_f32,
17035 size_y: 0.0_f32,
17036 target_num: 0_u8,
17037 frame: MavFrame::DEFAULT,
17038 x: 0.0_f32,
17039 y: 0.0_f32,
17040 z: 0.0_f32,
17041 q: [0.0_f32; 4usize],
17042 mavtype: LandingTargetType::DEFAULT,
17043 position_valid: 0_u8,
17044 };
17045 #[cfg(feature = "arbitrary")]
17046 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17047 use arbitrary::{Arbitrary, Unstructured};
17048 let mut buf = [0u8; 1024];
17049 rng.fill_bytes(&mut buf);
17050 let mut unstructured = Unstructured::new(&buf);
17051 Self::arbitrary(&mut unstructured).unwrap_or_default()
17052 }
17053}
17054impl Default for LANDING_TARGET_DATA {
17055 fn default() -> Self {
17056 Self::DEFAULT.clone()
17057 }
17058}
17059impl MessageData for LANDING_TARGET_DATA {
17060 type Message = MavMessage;
17061 const ID: u32 = 149u32;
17062 const NAME: &'static str = "LANDING_TARGET";
17063 const EXTRA_CRC: u8 = 200u8;
17064 const ENCODED_LEN: usize = 60usize;
17065 fn deser(
17066 _version: MavlinkVersion,
17067 __input: &[u8],
17068 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17069 let avail_len = __input.len();
17070 let mut payload_buf = [0; Self::ENCODED_LEN];
17071 let mut buf = if avail_len < Self::ENCODED_LEN {
17072 payload_buf[0..avail_len].copy_from_slice(__input);
17073 Bytes::new(&payload_buf)
17074 } else {
17075 Bytes::new(__input)
17076 };
17077 let mut __struct = Self::default();
17078 __struct.time_usec = buf.get_u64_le();
17079 __struct.angle_x = buf.get_f32_le();
17080 __struct.angle_y = buf.get_f32_le();
17081 __struct.distance = buf.get_f32_le();
17082 __struct.size_x = buf.get_f32_le();
17083 __struct.size_y = buf.get_f32_le();
17084 __struct.target_num = buf.get_u8();
17085 let tmp = buf.get_u8();
17086 __struct.frame =
17087 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17088 enum_type: "MavFrame",
17089 value: tmp as u32,
17090 })?;
17091 __struct.x = buf.get_f32_le();
17092 __struct.y = buf.get_f32_le();
17093 __struct.z = buf.get_f32_le();
17094 for v in &mut __struct.q {
17095 let val = buf.get_f32_le();
17096 *v = val;
17097 }
17098 let tmp = buf.get_u8();
17099 __struct.mavtype =
17100 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17101 enum_type: "LandingTargetType",
17102 value: tmp as u32,
17103 })?;
17104 __struct.position_valid = buf.get_u8();
17105 Ok(__struct)
17106 }
17107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17108 let mut __tmp = BytesMut::new(bytes);
17109 #[allow(clippy::absurd_extreme_comparisons)]
17110 #[allow(unused_comparisons)]
17111 if __tmp.remaining() < Self::ENCODED_LEN {
17112 panic!(
17113 "buffer is too small (need {} bytes, but got {})",
17114 Self::ENCODED_LEN,
17115 __tmp.remaining(),
17116 )
17117 }
17118 __tmp.put_u64_le(self.time_usec);
17119 __tmp.put_f32_le(self.angle_x);
17120 __tmp.put_f32_le(self.angle_y);
17121 __tmp.put_f32_le(self.distance);
17122 __tmp.put_f32_le(self.size_x);
17123 __tmp.put_f32_le(self.size_y);
17124 __tmp.put_u8(self.target_num);
17125 __tmp.put_u8(self.frame as u8);
17126 if matches!(version, MavlinkVersion::V2) {
17127 __tmp.put_f32_le(self.x);
17128 __tmp.put_f32_le(self.y);
17129 __tmp.put_f32_le(self.z);
17130 for val in &self.q {
17131 __tmp.put_f32_le(*val);
17132 }
17133 __tmp.put_u8(self.mavtype as u8);
17134 __tmp.put_u8(self.position_valid);
17135 let len = __tmp.len();
17136 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17137 } else {
17138 __tmp.len()
17139 }
17140 }
17141}
17142#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17143#[doc = ""]
17144#[doc = "ID: 8"]
17145#[derive(Debug, Clone, PartialEq)]
17146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17148pub struct LINK_NODE_STATUS_DATA {
17149 #[doc = "Timestamp (time since system boot)."]
17150 pub timestamp: u64,
17151 #[doc = "Transmit rate"]
17152 pub tx_rate: u32,
17153 #[doc = "Receive rate"]
17154 pub rx_rate: u32,
17155 #[doc = "Messages sent"]
17156 pub messages_sent: u32,
17157 #[doc = "Messages received (estimated from counting seq)"]
17158 pub messages_received: u32,
17159 #[doc = "Messages lost (estimated from counting seq)"]
17160 pub messages_lost: u32,
17161 #[doc = "Number of bytes that could not be parsed correctly."]
17162 pub rx_parse_err: u16,
17163 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17164 pub tx_overflows: u16,
17165 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17166 pub rx_overflows: u16,
17167 #[doc = "Remaining free transmit buffer space"]
17168 pub tx_buf: u8,
17169 #[doc = "Remaining free receive buffer space"]
17170 pub rx_buf: u8,
17171}
17172impl LINK_NODE_STATUS_DATA {
17173 pub const ENCODED_LEN: usize = 36usize;
17174 pub const DEFAULT: Self = Self {
17175 timestamp: 0_u64,
17176 tx_rate: 0_u32,
17177 rx_rate: 0_u32,
17178 messages_sent: 0_u32,
17179 messages_received: 0_u32,
17180 messages_lost: 0_u32,
17181 rx_parse_err: 0_u16,
17182 tx_overflows: 0_u16,
17183 rx_overflows: 0_u16,
17184 tx_buf: 0_u8,
17185 rx_buf: 0_u8,
17186 };
17187 #[cfg(feature = "arbitrary")]
17188 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17189 use arbitrary::{Arbitrary, Unstructured};
17190 let mut buf = [0u8; 1024];
17191 rng.fill_bytes(&mut buf);
17192 let mut unstructured = Unstructured::new(&buf);
17193 Self::arbitrary(&mut unstructured).unwrap_or_default()
17194 }
17195}
17196impl Default for LINK_NODE_STATUS_DATA {
17197 fn default() -> Self {
17198 Self::DEFAULT.clone()
17199 }
17200}
17201impl MessageData for LINK_NODE_STATUS_DATA {
17202 type Message = MavMessage;
17203 const ID: u32 = 8u32;
17204 const NAME: &'static str = "LINK_NODE_STATUS";
17205 const EXTRA_CRC: u8 = 117u8;
17206 const ENCODED_LEN: usize = 36usize;
17207 fn deser(
17208 _version: MavlinkVersion,
17209 __input: &[u8],
17210 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17211 let avail_len = __input.len();
17212 let mut payload_buf = [0; Self::ENCODED_LEN];
17213 let mut buf = if avail_len < Self::ENCODED_LEN {
17214 payload_buf[0..avail_len].copy_from_slice(__input);
17215 Bytes::new(&payload_buf)
17216 } else {
17217 Bytes::new(__input)
17218 };
17219 let mut __struct = Self::default();
17220 __struct.timestamp = buf.get_u64_le();
17221 __struct.tx_rate = buf.get_u32_le();
17222 __struct.rx_rate = buf.get_u32_le();
17223 __struct.messages_sent = buf.get_u32_le();
17224 __struct.messages_received = buf.get_u32_le();
17225 __struct.messages_lost = buf.get_u32_le();
17226 __struct.rx_parse_err = buf.get_u16_le();
17227 __struct.tx_overflows = buf.get_u16_le();
17228 __struct.rx_overflows = buf.get_u16_le();
17229 __struct.tx_buf = buf.get_u8();
17230 __struct.rx_buf = buf.get_u8();
17231 Ok(__struct)
17232 }
17233 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17234 let mut __tmp = BytesMut::new(bytes);
17235 #[allow(clippy::absurd_extreme_comparisons)]
17236 #[allow(unused_comparisons)]
17237 if __tmp.remaining() < Self::ENCODED_LEN {
17238 panic!(
17239 "buffer is too small (need {} bytes, but got {})",
17240 Self::ENCODED_LEN,
17241 __tmp.remaining(),
17242 )
17243 }
17244 __tmp.put_u64_le(self.timestamp);
17245 __tmp.put_u32_le(self.tx_rate);
17246 __tmp.put_u32_le(self.rx_rate);
17247 __tmp.put_u32_le(self.messages_sent);
17248 __tmp.put_u32_le(self.messages_received);
17249 __tmp.put_u32_le(self.messages_lost);
17250 __tmp.put_u16_le(self.rx_parse_err);
17251 __tmp.put_u16_le(self.tx_overflows);
17252 __tmp.put_u16_le(self.rx_overflows);
17253 __tmp.put_u8(self.tx_buf);
17254 __tmp.put_u8(self.rx_buf);
17255 if matches!(version, MavlinkVersion::V2) {
17256 let len = __tmp.len();
17257 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17258 } else {
17259 __tmp.len()
17260 }
17261 }
17262}
17263#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17264#[doc = ""]
17265#[doc = "ID: 32"]
17266#[derive(Debug, Clone, PartialEq)]
17267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17269pub struct LOCAL_POSITION_NED_DATA {
17270 #[doc = "Timestamp (time since system boot)."]
17271 pub time_boot_ms: u32,
17272 #[doc = "X Position"]
17273 pub x: f32,
17274 #[doc = "Y Position"]
17275 pub y: f32,
17276 #[doc = "Z Position"]
17277 pub z: f32,
17278 #[doc = "X Speed"]
17279 pub vx: f32,
17280 #[doc = "Y Speed"]
17281 pub vy: f32,
17282 #[doc = "Z Speed"]
17283 pub vz: f32,
17284}
17285impl LOCAL_POSITION_NED_DATA {
17286 pub const ENCODED_LEN: usize = 28usize;
17287 pub const DEFAULT: Self = Self {
17288 time_boot_ms: 0_u32,
17289 x: 0.0_f32,
17290 y: 0.0_f32,
17291 z: 0.0_f32,
17292 vx: 0.0_f32,
17293 vy: 0.0_f32,
17294 vz: 0.0_f32,
17295 };
17296 #[cfg(feature = "arbitrary")]
17297 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17298 use arbitrary::{Arbitrary, Unstructured};
17299 let mut buf = [0u8; 1024];
17300 rng.fill_bytes(&mut buf);
17301 let mut unstructured = Unstructured::new(&buf);
17302 Self::arbitrary(&mut unstructured).unwrap_or_default()
17303 }
17304}
17305impl Default for LOCAL_POSITION_NED_DATA {
17306 fn default() -> Self {
17307 Self::DEFAULT.clone()
17308 }
17309}
17310impl MessageData for LOCAL_POSITION_NED_DATA {
17311 type Message = MavMessage;
17312 const ID: u32 = 32u32;
17313 const NAME: &'static str = "LOCAL_POSITION_NED";
17314 const EXTRA_CRC: u8 = 185u8;
17315 const ENCODED_LEN: usize = 28usize;
17316 fn deser(
17317 _version: MavlinkVersion,
17318 __input: &[u8],
17319 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17320 let avail_len = __input.len();
17321 let mut payload_buf = [0; Self::ENCODED_LEN];
17322 let mut buf = if avail_len < Self::ENCODED_LEN {
17323 payload_buf[0..avail_len].copy_from_slice(__input);
17324 Bytes::new(&payload_buf)
17325 } else {
17326 Bytes::new(__input)
17327 };
17328 let mut __struct = Self::default();
17329 __struct.time_boot_ms = buf.get_u32_le();
17330 __struct.x = buf.get_f32_le();
17331 __struct.y = buf.get_f32_le();
17332 __struct.z = buf.get_f32_le();
17333 __struct.vx = buf.get_f32_le();
17334 __struct.vy = buf.get_f32_le();
17335 __struct.vz = buf.get_f32_le();
17336 Ok(__struct)
17337 }
17338 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17339 let mut __tmp = BytesMut::new(bytes);
17340 #[allow(clippy::absurd_extreme_comparisons)]
17341 #[allow(unused_comparisons)]
17342 if __tmp.remaining() < Self::ENCODED_LEN {
17343 panic!(
17344 "buffer is too small (need {} bytes, but got {})",
17345 Self::ENCODED_LEN,
17346 __tmp.remaining(),
17347 )
17348 }
17349 __tmp.put_u32_le(self.time_boot_ms);
17350 __tmp.put_f32_le(self.x);
17351 __tmp.put_f32_le(self.y);
17352 __tmp.put_f32_le(self.z);
17353 __tmp.put_f32_le(self.vx);
17354 __tmp.put_f32_le(self.vy);
17355 __tmp.put_f32_le(self.vz);
17356 if matches!(version, MavlinkVersion::V2) {
17357 let len = __tmp.len();
17358 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17359 } else {
17360 __tmp.len()
17361 }
17362 }
17363}
17364#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17365#[doc = ""]
17366#[doc = "ID: 64"]
17367#[derive(Debug, Clone, PartialEq)]
17368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17370pub struct LOCAL_POSITION_NED_COV_DATA {
17371 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17372 pub time_usec: u64,
17373 #[doc = "X Position"]
17374 pub x: f32,
17375 #[doc = "Y Position"]
17376 pub y: f32,
17377 #[doc = "Z Position"]
17378 pub z: f32,
17379 #[doc = "X Speed"]
17380 pub vx: f32,
17381 #[doc = "Y Speed"]
17382 pub vy: f32,
17383 #[doc = "Z Speed"]
17384 pub vz: f32,
17385 #[doc = "X Acceleration"]
17386 pub ax: f32,
17387 #[doc = "Y Acceleration"]
17388 pub ay: f32,
17389 #[doc = "Z Acceleration"]
17390 pub az: f32,
17391 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17392 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17393 pub covariance: [f32; 45],
17394 #[doc = "Class id of the estimator this estimate originated from."]
17395 pub estimator_type: MavEstimatorType,
17396}
17397impl LOCAL_POSITION_NED_COV_DATA {
17398 pub const ENCODED_LEN: usize = 225usize;
17399 pub const DEFAULT: Self = Self {
17400 time_usec: 0_u64,
17401 x: 0.0_f32,
17402 y: 0.0_f32,
17403 z: 0.0_f32,
17404 vx: 0.0_f32,
17405 vy: 0.0_f32,
17406 vz: 0.0_f32,
17407 ax: 0.0_f32,
17408 ay: 0.0_f32,
17409 az: 0.0_f32,
17410 covariance: [0.0_f32; 45usize],
17411 estimator_type: MavEstimatorType::DEFAULT,
17412 };
17413 #[cfg(feature = "arbitrary")]
17414 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17415 use arbitrary::{Arbitrary, Unstructured};
17416 let mut buf = [0u8; 1024];
17417 rng.fill_bytes(&mut buf);
17418 let mut unstructured = Unstructured::new(&buf);
17419 Self::arbitrary(&mut unstructured).unwrap_or_default()
17420 }
17421}
17422impl Default for LOCAL_POSITION_NED_COV_DATA {
17423 fn default() -> Self {
17424 Self::DEFAULT.clone()
17425 }
17426}
17427impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17428 type Message = MavMessage;
17429 const ID: u32 = 64u32;
17430 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17431 const EXTRA_CRC: u8 = 191u8;
17432 const ENCODED_LEN: usize = 225usize;
17433 fn deser(
17434 _version: MavlinkVersion,
17435 __input: &[u8],
17436 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17437 let avail_len = __input.len();
17438 let mut payload_buf = [0; Self::ENCODED_LEN];
17439 let mut buf = if avail_len < Self::ENCODED_LEN {
17440 payload_buf[0..avail_len].copy_from_slice(__input);
17441 Bytes::new(&payload_buf)
17442 } else {
17443 Bytes::new(__input)
17444 };
17445 let mut __struct = Self::default();
17446 __struct.time_usec = buf.get_u64_le();
17447 __struct.x = buf.get_f32_le();
17448 __struct.y = buf.get_f32_le();
17449 __struct.z = buf.get_f32_le();
17450 __struct.vx = buf.get_f32_le();
17451 __struct.vy = buf.get_f32_le();
17452 __struct.vz = buf.get_f32_le();
17453 __struct.ax = buf.get_f32_le();
17454 __struct.ay = buf.get_f32_le();
17455 __struct.az = buf.get_f32_le();
17456 for v in &mut __struct.covariance {
17457 let val = buf.get_f32_le();
17458 *v = val;
17459 }
17460 let tmp = buf.get_u8();
17461 __struct.estimator_type =
17462 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17463 enum_type: "MavEstimatorType",
17464 value: tmp as u32,
17465 })?;
17466 Ok(__struct)
17467 }
17468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17469 let mut __tmp = BytesMut::new(bytes);
17470 #[allow(clippy::absurd_extreme_comparisons)]
17471 #[allow(unused_comparisons)]
17472 if __tmp.remaining() < Self::ENCODED_LEN {
17473 panic!(
17474 "buffer is too small (need {} bytes, but got {})",
17475 Self::ENCODED_LEN,
17476 __tmp.remaining(),
17477 )
17478 }
17479 __tmp.put_u64_le(self.time_usec);
17480 __tmp.put_f32_le(self.x);
17481 __tmp.put_f32_le(self.y);
17482 __tmp.put_f32_le(self.z);
17483 __tmp.put_f32_le(self.vx);
17484 __tmp.put_f32_le(self.vy);
17485 __tmp.put_f32_le(self.vz);
17486 __tmp.put_f32_le(self.ax);
17487 __tmp.put_f32_le(self.ay);
17488 __tmp.put_f32_le(self.az);
17489 for val in &self.covariance {
17490 __tmp.put_f32_le(*val);
17491 }
17492 __tmp.put_u8(self.estimator_type as u8);
17493 if matches!(version, MavlinkVersion::V2) {
17494 let len = __tmp.len();
17495 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17496 } else {
17497 __tmp.len()
17498 }
17499 }
17500}
17501#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17502#[doc = ""]
17503#[doc = "ID: 89"]
17504#[derive(Debug, Clone, PartialEq)]
17505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17507pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17508 #[doc = "Timestamp (time since system boot)."]
17509 pub time_boot_ms: u32,
17510 #[doc = "X Position"]
17511 pub x: f32,
17512 #[doc = "Y Position"]
17513 pub y: f32,
17514 #[doc = "Z Position"]
17515 pub z: f32,
17516 #[doc = "Roll"]
17517 pub roll: f32,
17518 #[doc = "Pitch"]
17519 pub pitch: f32,
17520 #[doc = "Yaw"]
17521 pub yaw: f32,
17522}
17523impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17524 pub const ENCODED_LEN: usize = 28usize;
17525 pub const DEFAULT: Self = Self {
17526 time_boot_ms: 0_u32,
17527 x: 0.0_f32,
17528 y: 0.0_f32,
17529 z: 0.0_f32,
17530 roll: 0.0_f32,
17531 pitch: 0.0_f32,
17532 yaw: 0.0_f32,
17533 };
17534 #[cfg(feature = "arbitrary")]
17535 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17536 use arbitrary::{Arbitrary, Unstructured};
17537 let mut buf = [0u8; 1024];
17538 rng.fill_bytes(&mut buf);
17539 let mut unstructured = Unstructured::new(&buf);
17540 Self::arbitrary(&mut unstructured).unwrap_or_default()
17541 }
17542}
17543impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17544 fn default() -> Self {
17545 Self::DEFAULT.clone()
17546 }
17547}
17548impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17549 type Message = MavMessage;
17550 const ID: u32 = 89u32;
17551 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17552 const EXTRA_CRC: u8 = 231u8;
17553 const ENCODED_LEN: usize = 28usize;
17554 fn deser(
17555 _version: MavlinkVersion,
17556 __input: &[u8],
17557 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17558 let avail_len = __input.len();
17559 let mut payload_buf = [0; Self::ENCODED_LEN];
17560 let mut buf = if avail_len < Self::ENCODED_LEN {
17561 payload_buf[0..avail_len].copy_from_slice(__input);
17562 Bytes::new(&payload_buf)
17563 } else {
17564 Bytes::new(__input)
17565 };
17566 let mut __struct = Self::default();
17567 __struct.time_boot_ms = buf.get_u32_le();
17568 __struct.x = buf.get_f32_le();
17569 __struct.y = buf.get_f32_le();
17570 __struct.z = buf.get_f32_le();
17571 __struct.roll = buf.get_f32_le();
17572 __struct.pitch = buf.get_f32_le();
17573 __struct.yaw = buf.get_f32_le();
17574 Ok(__struct)
17575 }
17576 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17577 let mut __tmp = BytesMut::new(bytes);
17578 #[allow(clippy::absurd_extreme_comparisons)]
17579 #[allow(unused_comparisons)]
17580 if __tmp.remaining() < Self::ENCODED_LEN {
17581 panic!(
17582 "buffer is too small (need {} bytes, but got {})",
17583 Self::ENCODED_LEN,
17584 __tmp.remaining(),
17585 )
17586 }
17587 __tmp.put_u32_le(self.time_boot_ms);
17588 __tmp.put_f32_le(self.x);
17589 __tmp.put_f32_le(self.y);
17590 __tmp.put_f32_le(self.z);
17591 __tmp.put_f32_le(self.roll);
17592 __tmp.put_f32_le(self.pitch);
17593 __tmp.put_f32_le(self.yaw);
17594 if matches!(version, MavlinkVersion::V2) {
17595 let len = __tmp.len();
17596 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17597 } else {
17598 __tmp.len()
17599 }
17600 }
17601}
17602#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17603#[doc = ""]
17604#[doc = "ID: 268"]
17605#[derive(Debug, Clone, PartialEq)]
17606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17607#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17608pub struct LOGGING_ACK_DATA {
17609 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17610 pub sequence: u16,
17611 #[doc = "system ID of the target"]
17612 pub target_system: u8,
17613 #[doc = "component ID of the target"]
17614 pub target_component: u8,
17615}
17616impl LOGGING_ACK_DATA {
17617 pub const ENCODED_LEN: usize = 4usize;
17618 pub const DEFAULT: Self = Self {
17619 sequence: 0_u16,
17620 target_system: 0_u8,
17621 target_component: 0_u8,
17622 };
17623 #[cfg(feature = "arbitrary")]
17624 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17625 use arbitrary::{Arbitrary, Unstructured};
17626 let mut buf = [0u8; 1024];
17627 rng.fill_bytes(&mut buf);
17628 let mut unstructured = Unstructured::new(&buf);
17629 Self::arbitrary(&mut unstructured).unwrap_or_default()
17630 }
17631}
17632impl Default for LOGGING_ACK_DATA {
17633 fn default() -> Self {
17634 Self::DEFAULT.clone()
17635 }
17636}
17637impl MessageData for LOGGING_ACK_DATA {
17638 type Message = MavMessage;
17639 const ID: u32 = 268u32;
17640 const NAME: &'static str = "LOGGING_ACK";
17641 const EXTRA_CRC: u8 = 14u8;
17642 const ENCODED_LEN: usize = 4usize;
17643 fn deser(
17644 _version: MavlinkVersion,
17645 __input: &[u8],
17646 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17647 let avail_len = __input.len();
17648 let mut payload_buf = [0; Self::ENCODED_LEN];
17649 let mut buf = if avail_len < Self::ENCODED_LEN {
17650 payload_buf[0..avail_len].copy_from_slice(__input);
17651 Bytes::new(&payload_buf)
17652 } else {
17653 Bytes::new(__input)
17654 };
17655 let mut __struct = Self::default();
17656 __struct.sequence = buf.get_u16_le();
17657 __struct.target_system = buf.get_u8();
17658 __struct.target_component = buf.get_u8();
17659 Ok(__struct)
17660 }
17661 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17662 let mut __tmp = BytesMut::new(bytes);
17663 #[allow(clippy::absurd_extreme_comparisons)]
17664 #[allow(unused_comparisons)]
17665 if __tmp.remaining() < Self::ENCODED_LEN {
17666 panic!(
17667 "buffer is too small (need {} bytes, but got {})",
17668 Self::ENCODED_LEN,
17669 __tmp.remaining(),
17670 )
17671 }
17672 __tmp.put_u16_le(self.sequence);
17673 __tmp.put_u8(self.target_system);
17674 __tmp.put_u8(self.target_component);
17675 if matches!(version, MavlinkVersion::V2) {
17676 let len = __tmp.len();
17677 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17678 } else {
17679 __tmp.len()
17680 }
17681 }
17682}
17683#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17684#[doc = ""]
17685#[doc = "ID: 266"]
17686#[derive(Debug, Clone, PartialEq)]
17687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17689pub struct LOGGING_DATA_DATA {
17690 #[doc = "sequence number (can wrap)"]
17691 pub sequence: u16,
17692 #[doc = "system ID of the target"]
17693 pub target_system: u8,
17694 #[doc = "component ID of the target"]
17695 pub target_component: u8,
17696 #[doc = "data length"]
17697 pub length: u8,
17698 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17699 pub first_message_offset: u8,
17700 #[doc = "logged data"]
17701 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17702 pub data: [u8; 249],
17703}
17704impl LOGGING_DATA_DATA {
17705 pub const ENCODED_LEN: usize = 255usize;
17706 pub const DEFAULT: Self = Self {
17707 sequence: 0_u16,
17708 target_system: 0_u8,
17709 target_component: 0_u8,
17710 length: 0_u8,
17711 first_message_offset: 0_u8,
17712 data: [0_u8; 249usize],
17713 };
17714 #[cfg(feature = "arbitrary")]
17715 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17716 use arbitrary::{Arbitrary, Unstructured};
17717 let mut buf = [0u8; 1024];
17718 rng.fill_bytes(&mut buf);
17719 let mut unstructured = Unstructured::new(&buf);
17720 Self::arbitrary(&mut unstructured).unwrap_or_default()
17721 }
17722}
17723impl Default for LOGGING_DATA_DATA {
17724 fn default() -> Self {
17725 Self::DEFAULT.clone()
17726 }
17727}
17728impl MessageData for LOGGING_DATA_DATA {
17729 type Message = MavMessage;
17730 const ID: u32 = 266u32;
17731 const NAME: &'static str = "LOGGING_DATA";
17732 const EXTRA_CRC: u8 = 193u8;
17733 const ENCODED_LEN: usize = 255usize;
17734 fn deser(
17735 _version: MavlinkVersion,
17736 __input: &[u8],
17737 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17738 let avail_len = __input.len();
17739 let mut payload_buf = [0; Self::ENCODED_LEN];
17740 let mut buf = if avail_len < Self::ENCODED_LEN {
17741 payload_buf[0..avail_len].copy_from_slice(__input);
17742 Bytes::new(&payload_buf)
17743 } else {
17744 Bytes::new(__input)
17745 };
17746 let mut __struct = Self::default();
17747 __struct.sequence = buf.get_u16_le();
17748 __struct.target_system = buf.get_u8();
17749 __struct.target_component = buf.get_u8();
17750 __struct.length = buf.get_u8();
17751 __struct.first_message_offset = buf.get_u8();
17752 for v in &mut __struct.data {
17753 let val = buf.get_u8();
17754 *v = val;
17755 }
17756 Ok(__struct)
17757 }
17758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17759 let mut __tmp = BytesMut::new(bytes);
17760 #[allow(clippy::absurd_extreme_comparisons)]
17761 #[allow(unused_comparisons)]
17762 if __tmp.remaining() < Self::ENCODED_LEN {
17763 panic!(
17764 "buffer is too small (need {} bytes, but got {})",
17765 Self::ENCODED_LEN,
17766 __tmp.remaining(),
17767 )
17768 }
17769 __tmp.put_u16_le(self.sequence);
17770 __tmp.put_u8(self.target_system);
17771 __tmp.put_u8(self.target_component);
17772 __tmp.put_u8(self.length);
17773 __tmp.put_u8(self.first_message_offset);
17774 for val in &self.data {
17775 __tmp.put_u8(*val);
17776 }
17777 if matches!(version, MavlinkVersion::V2) {
17778 let len = __tmp.len();
17779 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17780 } else {
17781 __tmp.len()
17782 }
17783 }
17784}
17785#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17786#[doc = ""]
17787#[doc = "ID: 267"]
17788#[derive(Debug, Clone, PartialEq)]
17789#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17790#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17791pub struct LOGGING_DATA_ACKED_DATA {
17792 #[doc = "sequence number (can wrap)"]
17793 pub sequence: u16,
17794 #[doc = "system ID of the target"]
17795 pub target_system: u8,
17796 #[doc = "component ID of the target"]
17797 pub target_component: u8,
17798 #[doc = "data length"]
17799 pub length: u8,
17800 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17801 pub first_message_offset: u8,
17802 #[doc = "logged data"]
17803 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17804 pub data: [u8; 249],
17805}
17806impl LOGGING_DATA_ACKED_DATA {
17807 pub const ENCODED_LEN: usize = 255usize;
17808 pub const DEFAULT: Self = Self {
17809 sequence: 0_u16,
17810 target_system: 0_u8,
17811 target_component: 0_u8,
17812 length: 0_u8,
17813 first_message_offset: 0_u8,
17814 data: [0_u8; 249usize],
17815 };
17816 #[cfg(feature = "arbitrary")]
17817 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17818 use arbitrary::{Arbitrary, Unstructured};
17819 let mut buf = [0u8; 1024];
17820 rng.fill_bytes(&mut buf);
17821 let mut unstructured = Unstructured::new(&buf);
17822 Self::arbitrary(&mut unstructured).unwrap_or_default()
17823 }
17824}
17825impl Default for LOGGING_DATA_ACKED_DATA {
17826 fn default() -> Self {
17827 Self::DEFAULT.clone()
17828 }
17829}
17830impl MessageData for LOGGING_DATA_ACKED_DATA {
17831 type Message = MavMessage;
17832 const ID: u32 = 267u32;
17833 const NAME: &'static str = "LOGGING_DATA_ACKED";
17834 const EXTRA_CRC: u8 = 35u8;
17835 const ENCODED_LEN: usize = 255usize;
17836 fn deser(
17837 _version: MavlinkVersion,
17838 __input: &[u8],
17839 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17840 let avail_len = __input.len();
17841 let mut payload_buf = [0; Self::ENCODED_LEN];
17842 let mut buf = if avail_len < Self::ENCODED_LEN {
17843 payload_buf[0..avail_len].copy_from_slice(__input);
17844 Bytes::new(&payload_buf)
17845 } else {
17846 Bytes::new(__input)
17847 };
17848 let mut __struct = Self::default();
17849 __struct.sequence = buf.get_u16_le();
17850 __struct.target_system = buf.get_u8();
17851 __struct.target_component = buf.get_u8();
17852 __struct.length = buf.get_u8();
17853 __struct.first_message_offset = buf.get_u8();
17854 for v in &mut __struct.data {
17855 let val = buf.get_u8();
17856 *v = val;
17857 }
17858 Ok(__struct)
17859 }
17860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17861 let mut __tmp = BytesMut::new(bytes);
17862 #[allow(clippy::absurd_extreme_comparisons)]
17863 #[allow(unused_comparisons)]
17864 if __tmp.remaining() < Self::ENCODED_LEN {
17865 panic!(
17866 "buffer is too small (need {} bytes, but got {})",
17867 Self::ENCODED_LEN,
17868 __tmp.remaining(),
17869 )
17870 }
17871 __tmp.put_u16_le(self.sequence);
17872 __tmp.put_u8(self.target_system);
17873 __tmp.put_u8(self.target_component);
17874 __tmp.put_u8(self.length);
17875 __tmp.put_u8(self.first_message_offset);
17876 for val in &self.data {
17877 __tmp.put_u8(*val);
17878 }
17879 if matches!(version, MavlinkVersion::V2) {
17880 let len = __tmp.len();
17881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17882 } else {
17883 __tmp.len()
17884 }
17885 }
17886}
17887#[doc = "Reply to LOG_REQUEST_DATA."]
17888#[doc = ""]
17889#[doc = "ID: 120"]
17890#[derive(Debug, Clone, PartialEq)]
17891#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17893pub struct LOG_DATA_DATA {
17894 #[doc = "Offset into the log"]
17895 pub ofs: u32,
17896 #[doc = "Log id (from LOG_ENTRY reply)"]
17897 pub id: u16,
17898 #[doc = "Number of bytes (zero for end of log)"]
17899 pub count: u8,
17900 #[doc = "log data"]
17901 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17902 pub data: [u8; 90],
17903}
17904impl LOG_DATA_DATA {
17905 pub const ENCODED_LEN: usize = 97usize;
17906 pub const DEFAULT: Self = Self {
17907 ofs: 0_u32,
17908 id: 0_u16,
17909 count: 0_u8,
17910 data: [0_u8; 90usize],
17911 };
17912 #[cfg(feature = "arbitrary")]
17913 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17914 use arbitrary::{Arbitrary, Unstructured};
17915 let mut buf = [0u8; 1024];
17916 rng.fill_bytes(&mut buf);
17917 let mut unstructured = Unstructured::new(&buf);
17918 Self::arbitrary(&mut unstructured).unwrap_or_default()
17919 }
17920}
17921impl Default for LOG_DATA_DATA {
17922 fn default() -> Self {
17923 Self::DEFAULT.clone()
17924 }
17925}
17926impl MessageData for LOG_DATA_DATA {
17927 type Message = MavMessage;
17928 const ID: u32 = 120u32;
17929 const NAME: &'static str = "LOG_DATA";
17930 const EXTRA_CRC: u8 = 134u8;
17931 const ENCODED_LEN: usize = 97usize;
17932 fn deser(
17933 _version: MavlinkVersion,
17934 __input: &[u8],
17935 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17936 let avail_len = __input.len();
17937 let mut payload_buf = [0; Self::ENCODED_LEN];
17938 let mut buf = if avail_len < Self::ENCODED_LEN {
17939 payload_buf[0..avail_len].copy_from_slice(__input);
17940 Bytes::new(&payload_buf)
17941 } else {
17942 Bytes::new(__input)
17943 };
17944 let mut __struct = Self::default();
17945 __struct.ofs = buf.get_u32_le();
17946 __struct.id = buf.get_u16_le();
17947 __struct.count = buf.get_u8();
17948 for v in &mut __struct.data {
17949 let val = buf.get_u8();
17950 *v = val;
17951 }
17952 Ok(__struct)
17953 }
17954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17955 let mut __tmp = BytesMut::new(bytes);
17956 #[allow(clippy::absurd_extreme_comparisons)]
17957 #[allow(unused_comparisons)]
17958 if __tmp.remaining() < Self::ENCODED_LEN {
17959 panic!(
17960 "buffer is too small (need {} bytes, but got {})",
17961 Self::ENCODED_LEN,
17962 __tmp.remaining(),
17963 )
17964 }
17965 __tmp.put_u32_le(self.ofs);
17966 __tmp.put_u16_le(self.id);
17967 __tmp.put_u8(self.count);
17968 for val in &self.data {
17969 __tmp.put_u8(*val);
17970 }
17971 if matches!(version, MavlinkVersion::V2) {
17972 let len = __tmp.len();
17973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17974 } else {
17975 __tmp.len()
17976 }
17977 }
17978}
17979#[doc = "Reply to LOG_REQUEST_LIST."]
17980#[doc = ""]
17981#[doc = "ID: 118"]
17982#[derive(Debug, Clone, PartialEq)]
17983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17985pub struct LOG_ENTRY_DATA {
17986 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
17987 pub time_utc: u32,
17988 #[doc = "Size of the log (may be approximate)"]
17989 pub size: u32,
17990 #[doc = "Log id"]
17991 pub id: u16,
17992 #[doc = "Total number of logs"]
17993 pub num_logs: u16,
17994 #[doc = "High log number"]
17995 pub last_log_num: u16,
17996}
17997impl LOG_ENTRY_DATA {
17998 pub const ENCODED_LEN: usize = 14usize;
17999 pub const DEFAULT: Self = Self {
18000 time_utc: 0_u32,
18001 size: 0_u32,
18002 id: 0_u16,
18003 num_logs: 0_u16,
18004 last_log_num: 0_u16,
18005 };
18006 #[cfg(feature = "arbitrary")]
18007 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18008 use arbitrary::{Arbitrary, Unstructured};
18009 let mut buf = [0u8; 1024];
18010 rng.fill_bytes(&mut buf);
18011 let mut unstructured = Unstructured::new(&buf);
18012 Self::arbitrary(&mut unstructured).unwrap_or_default()
18013 }
18014}
18015impl Default for LOG_ENTRY_DATA {
18016 fn default() -> Self {
18017 Self::DEFAULT.clone()
18018 }
18019}
18020impl MessageData for LOG_ENTRY_DATA {
18021 type Message = MavMessage;
18022 const ID: u32 = 118u32;
18023 const NAME: &'static str = "LOG_ENTRY";
18024 const EXTRA_CRC: u8 = 56u8;
18025 const ENCODED_LEN: usize = 14usize;
18026 fn deser(
18027 _version: MavlinkVersion,
18028 __input: &[u8],
18029 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18030 let avail_len = __input.len();
18031 let mut payload_buf = [0; Self::ENCODED_LEN];
18032 let mut buf = if avail_len < Self::ENCODED_LEN {
18033 payload_buf[0..avail_len].copy_from_slice(__input);
18034 Bytes::new(&payload_buf)
18035 } else {
18036 Bytes::new(__input)
18037 };
18038 let mut __struct = Self::default();
18039 __struct.time_utc = buf.get_u32_le();
18040 __struct.size = buf.get_u32_le();
18041 __struct.id = buf.get_u16_le();
18042 __struct.num_logs = buf.get_u16_le();
18043 __struct.last_log_num = buf.get_u16_le();
18044 Ok(__struct)
18045 }
18046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18047 let mut __tmp = BytesMut::new(bytes);
18048 #[allow(clippy::absurd_extreme_comparisons)]
18049 #[allow(unused_comparisons)]
18050 if __tmp.remaining() < Self::ENCODED_LEN {
18051 panic!(
18052 "buffer is too small (need {} bytes, but got {})",
18053 Self::ENCODED_LEN,
18054 __tmp.remaining(),
18055 )
18056 }
18057 __tmp.put_u32_le(self.time_utc);
18058 __tmp.put_u32_le(self.size);
18059 __tmp.put_u16_le(self.id);
18060 __tmp.put_u16_le(self.num_logs);
18061 __tmp.put_u16_le(self.last_log_num);
18062 if matches!(version, MavlinkVersion::V2) {
18063 let len = __tmp.len();
18064 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18065 } else {
18066 __tmp.len()
18067 }
18068 }
18069}
18070#[doc = "Erase all logs."]
18071#[doc = ""]
18072#[doc = "ID: 121"]
18073#[derive(Debug, Clone, PartialEq)]
18074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18076pub struct LOG_ERASE_DATA {
18077 #[doc = "System ID"]
18078 pub target_system: u8,
18079 #[doc = "Component ID"]
18080 pub target_component: u8,
18081}
18082impl LOG_ERASE_DATA {
18083 pub const ENCODED_LEN: usize = 2usize;
18084 pub const DEFAULT: Self = Self {
18085 target_system: 0_u8,
18086 target_component: 0_u8,
18087 };
18088 #[cfg(feature = "arbitrary")]
18089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18090 use arbitrary::{Arbitrary, Unstructured};
18091 let mut buf = [0u8; 1024];
18092 rng.fill_bytes(&mut buf);
18093 let mut unstructured = Unstructured::new(&buf);
18094 Self::arbitrary(&mut unstructured).unwrap_or_default()
18095 }
18096}
18097impl Default for LOG_ERASE_DATA {
18098 fn default() -> Self {
18099 Self::DEFAULT.clone()
18100 }
18101}
18102impl MessageData for LOG_ERASE_DATA {
18103 type Message = MavMessage;
18104 const ID: u32 = 121u32;
18105 const NAME: &'static str = "LOG_ERASE";
18106 const EXTRA_CRC: u8 = 237u8;
18107 const ENCODED_LEN: usize = 2usize;
18108 fn deser(
18109 _version: MavlinkVersion,
18110 __input: &[u8],
18111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18112 let avail_len = __input.len();
18113 let mut payload_buf = [0; Self::ENCODED_LEN];
18114 let mut buf = if avail_len < Self::ENCODED_LEN {
18115 payload_buf[0..avail_len].copy_from_slice(__input);
18116 Bytes::new(&payload_buf)
18117 } else {
18118 Bytes::new(__input)
18119 };
18120 let mut __struct = Self::default();
18121 __struct.target_system = buf.get_u8();
18122 __struct.target_component = buf.get_u8();
18123 Ok(__struct)
18124 }
18125 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18126 let mut __tmp = BytesMut::new(bytes);
18127 #[allow(clippy::absurd_extreme_comparisons)]
18128 #[allow(unused_comparisons)]
18129 if __tmp.remaining() < Self::ENCODED_LEN {
18130 panic!(
18131 "buffer is too small (need {} bytes, but got {})",
18132 Self::ENCODED_LEN,
18133 __tmp.remaining(),
18134 )
18135 }
18136 __tmp.put_u8(self.target_system);
18137 __tmp.put_u8(self.target_component);
18138 if matches!(version, MavlinkVersion::V2) {
18139 let len = __tmp.len();
18140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18141 } else {
18142 __tmp.len()
18143 }
18144 }
18145}
18146#[doc = "Request a chunk of a log."]
18147#[doc = ""]
18148#[doc = "ID: 119"]
18149#[derive(Debug, Clone, PartialEq)]
18150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18152pub struct LOG_REQUEST_DATA_DATA {
18153 #[doc = "Offset into the log"]
18154 pub ofs: u32,
18155 #[doc = "Number of bytes"]
18156 pub count: u32,
18157 #[doc = "Log id (from LOG_ENTRY reply)"]
18158 pub id: u16,
18159 #[doc = "System ID"]
18160 pub target_system: u8,
18161 #[doc = "Component ID"]
18162 pub target_component: u8,
18163}
18164impl LOG_REQUEST_DATA_DATA {
18165 pub const ENCODED_LEN: usize = 12usize;
18166 pub const DEFAULT: Self = Self {
18167 ofs: 0_u32,
18168 count: 0_u32,
18169 id: 0_u16,
18170 target_system: 0_u8,
18171 target_component: 0_u8,
18172 };
18173 #[cfg(feature = "arbitrary")]
18174 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18175 use arbitrary::{Arbitrary, Unstructured};
18176 let mut buf = [0u8; 1024];
18177 rng.fill_bytes(&mut buf);
18178 let mut unstructured = Unstructured::new(&buf);
18179 Self::arbitrary(&mut unstructured).unwrap_or_default()
18180 }
18181}
18182impl Default for LOG_REQUEST_DATA_DATA {
18183 fn default() -> Self {
18184 Self::DEFAULT.clone()
18185 }
18186}
18187impl MessageData for LOG_REQUEST_DATA_DATA {
18188 type Message = MavMessage;
18189 const ID: u32 = 119u32;
18190 const NAME: &'static str = "LOG_REQUEST_DATA";
18191 const EXTRA_CRC: u8 = 116u8;
18192 const ENCODED_LEN: usize = 12usize;
18193 fn deser(
18194 _version: MavlinkVersion,
18195 __input: &[u8],
18196 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18197 let avail_len = __input.len();
18198 let mut payload_buf = [0; Self::ENCODED_LEN];
18199 let mut buf = if avail_len < Self::ENCODED_LEN {
18200 payload_buf[0..avail_len].copy_from_slice(__input);
18201 Bytes::new(&payload_buf)
18202 } else {
18203 Bytes::new(__input)
18204 };
18205 let mut __struct = Self::default();
18206 __struct.ofs = buf.get_u32_le();
18207 __struct.count = buf.get_u32_le();
18208 __struct.id = buf.get_u16_le();
18209 __struct.target_system = buf.get_u8();
18210 __struct.target_component = buf.get_u8();
18211 Ok(__struct)
18212 }
18213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18214 let mut __tmp = BytesMut::new(bytes);
18215 #[allow(clippy::absurd_extreme_comparisons)]
18216 #[allow(unused_comparisons)]
18217 if __tmp.remaining() < Self::ENCODED_LEN {
18218 panic!(
18219 "buffer is too small (need {} bytes, but got {})",
18220 Self::ENCODED_LEN,
18221 __tmp.remaining(),
18222 )
18223 }
18224 __tmp.put_u32_le(self.ofs);
18225 __tmp.put_u32_le(self.count);
18226 __tmp.put_u16_le(self.id);
18227 __tmp.put_u8(self.target_system);
18228 __tmp.put_u8(self.target_component);
18229 if matches!(version, MavlinkVersion::V2) {
18230 let len = __tmp.len();
18231 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18232 } else {
18233 __tmp.len()
18234 }
18235 }
18236}
18237#[doc = "Stop log transfer and resume normal logging."]
18238#[doc = ""]
18239#[doc = "ID: 122"]
18240#[derive(Debug, Clone, PartialEq)]
18241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18243pub struct LOG_REQUEST_END_DATA {
18244 #[doc = "System ID"]
18245 pub target_system: u8,
18246 #[doc = "Component ID"]
18247 pub target_component: u8,
18248}
18249impl LOG_REQUEST_END_DATA {
18250 pub const ENCODED_LEN: usize = 2usize;
18251 pub const DEFAULT: Self = Self {
18252 target_system: 0_u8,
18253 target_component: 0_u8,
18254 };
18255 #[cfg(feature = "arbitrary")]
18256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18257 use arbitrary::{Arbitrary, Unstructured};
18258 let mut buf = [0u8; 1024];
18259 rng.fill_bytes(&mut buf);
18260 let mut unstructured = Unstructured::new(&buf);
18261 Self::arbitrary(&mut unstructured).unwrap_or_default()
18262 }
18263}
18264impl Default for LOG_REQUEST_END_DATA {
18265 fn default() -> Self {
18266 Self::DEFAULT.clone()
18267 }
18268}
18269impl MessageData for LOG_REQUEST_END_DATA {
18270 type Message = MavMessage;
18271 const ID: u32 = 122u32;
18272 const NAME: &'static str = "LOG_REQUEST_END";
18273 const EXTRA_CRC: u8 = 203u8;
18274 const ENCODED_LEN: usize = 2usize;
18275 fn deser(
18276 _version: MavlinkVersion,
18277 __input: &[u8],
18278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18279 let avail_len = __input.len();
18280 let mut payload_buf = [0; Self::ENCODED_LEN];
18281 let mut buf = if avail_len < Self::ENCODED_LEN {
18282 payload_buf[0..avail_len].copy_from_slice(__input);
18283 Bytes::new(&payload_buf)
18284 } else {
18285 Bytes::new(__input)
18286 };
18287 let mut __struct = Self::default();
18288 __struct.target_system = buf.get_u8();
18289 __struct.target_component = buf.get_u8();
18290 Ok(__struct)
18291 }
18292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18293 let mut __tmp = BytesMut::new(bytes);
18294 #[allow(clippy::absurd_extreme_comparisons)]
18295 #[allow(unused_comparisons)]
18296 if __tmp.remaining() < Self::ENCODED_LEN {
18297 panic!(
18298 "buffer is too small (need {} bytes, but got {})",
18299 Self::ENCODED_LEN,
18300 __tmp.remaining(),
18301 )
18302 }
18303 __tmp.put_u8(self.target_system);
18304 __tmp.put_u8(self.target_component);
18305 if matches!(version, MavlinkVersion::V2) {
18306 let len = __tmp.len();
18307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18308 } else {
18309 __tmp.len()
18310 }
18311 }
18312}
18313#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18314#[doc = ""]
18315#[doc = "ID: 117"]
18316#[derive(Debug, Clone, PartialEq)]
18317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18319pub struct LOG_REQUEST_LIST_DATA {
18320 #[doc = "First log id (0 for first available)"]
18321 pub start: u16,
18322 #[doc = "Last log id (0xffff for last available)"]
18323 pub end: u16,
18324 #[doc = "System ID"]
18325 pub target_system: u8,
18326 #[doc = "Component ID"]
18327 pub target_component: u8,
18328}
18329impl LOG_REQUEST_LIST_DATA {
18330 pub const ENCODED_LEN: usize = 6usize;
18331 pub const DEFAULT: Self = Self {
18332 start: 0_u16,
18333 end: 0_u16,
18334 target_system: 0_u8,
18335 target_component: 0_u8,
18336 };
18337 #[cfg(feature = "arbitrary")]
18338 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18339 use arbitrary::{Arbitrary, Unstructured};
18340 let mut buf = [0u8; 1024];
18341 rng.fill_bytes(&mut buf);
18342 let mut unstructured = Unstructured::new(&buf);
18343 Self::arbitrary(&mut unstructured).unwrap_or_default()
18344 }
18345}
18346impl Default for LOG_REQUEST_LIST_DATA {
18347 fn default() -> Self {
18348 Self::DEFAULT.clone()
18349 }
18350}
18351impl MessageData for LOG_REQUEST_LIST_DATA {
18352 type Message = MavMessage;
18353 const ID: u32 = 117u32;
18354 const NAME: &'static str = "LOG_REQUEST_LIST";
18355 const EXTRA_CRC: u8 = 128u8;
18356 const ENCODED_LEN: usize = 6usize;
18357 fn deser(
18358 _version: MavlinkVersion,
18359 __input: &[u8],
18360 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18361 let avail_len = __input.len();
18362 let mut payload_buf = [0; Self::ENCODED_LEN];
18363 let mut buf = if avail_len < Self::ENCODED_LEN {
18364 payload_buf[0..avail_len].copy_from_slice(__input);
18365 Bytes::new(&payload_buf)
18366 } else {
18367 Bytes::new(__input)
18368 };
18369 let mut __struct = Self::default();
18370 __struct.start = buf.get_u16_le();
18371 __struct.end = buf.get_u16_le();
18372 __struct.target_system = buf.get_u8();
18373 __struct.target_component = buf.get_u8();
18374 Ok(__struct)
18375 }
18376 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18377 let mut __tmp = BytesMut::new(bytes);
18378 #[allow(clippy::absurd_extreme_comparisons)]
18379 #[allow(unused_comparisons)]
18380 if __tmp.remaining() < Self::ENCODED_LEN {
18381 panic!(
18382 "buffer is too small (need {} bytes, but got {})",
18383 Self::ENCODED_LEN,
18384 __tmp.remaining(),
18385 )
18386 }
18387 __tmp.put_u16_le(self.start);
18388 __tmp.put_u16_le(self.end);
18389 __tmp.put_u8(self.target_system);
18390 __tmp.put_u8(self.target_component);
18391 if matches!(version, MavlinkVersion::V2) {
18392 let len = __tmp.len();
18393 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18394 } else {
18395 __tmp.len()
18396 }
18397 }
18398}
18399#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18400#[doc = ""]
18401#[doc = "ID: 192"]
18402#[derive(Debug, Clone, PartialEq)]
18403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18404#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18405pub struct MAG_CAL_REPORT_DATA {
18406 #[doc = "RMS milligauss residuals."]
18407 pub fitness: f32,
18408 #[doc = "X offset."]
18409 pub ofs_x: f32,
18410 #[doc = "Y offset."]
18411 pub ofs_y: f32,
18412 #[doc = "Z offset."]
18413 pub ofs_z: f32,
18414 #[doc = "X diagonal (matrix 11)."]
18415 pub diag_x: f32,
18416 #[doc = "Y diagonal (matrix 22)."]
18417 pub diag_y: f32,
18418 #[doc = "Z diagonal (matrix 33)."]
18419 pub diag_z: f32,
18420 #[doc = "X off-diagonal (matrix 12 and 21)."]
18421 pub offdiag_x: f32,
18422 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18423 pub offdiag_y: f32,
18424 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18425 pub offdiag_z: f32,
18426 #[doc = "Compass being calibrated."]
18427 pub compass_id: u8,
18428 #[doc = "Bitmask of compasses being calibrated."]
18429 pub cal_mask: u8,
18430 #[doc = "Calibration Status."]
18431 pub cal_status: MagCalStatus,
18432 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18433 pub autosaved: u8,
18434 #[doc = "Confidence in orientation (higher is better)."]
18435 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18436 pub orientation_confidence: f32,
18437 #[doc = "orientation before calibration."]
18438 #[cfg_attr(feature = "serde", serde(default))]
18439 pub old_orientation: MavSensorOrientation,
18440 #[doc = "orientation after calibration."]
18441 #[cfg_attr(feature = "serde", serde(default))]
18442 pub new_orientation: MavSensorOrientation,
18443 #[doc = "field radius correction factor"]
18444 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18445 pub scale_factor: f32,
18446}
18447impl MAG_CAL_REPORT_DATA {
18448 pub const ENCODED_LEN: usize = 54usize;
18449 pub const DEFAULT: Self = Self {
18450 fitness: 0.0_f32,
18451 ofs_x: 0.0_f32,
18452 ofs_y: 0.0_f32,
18453 ofs_z: 0.0_f32,
18454 diag_x: 0.0_f32,
18455 diag_y: 0.0_f32,
18456 diag_z: 0.0_f32,
18457 offdiag_x: 0.0_f32,
18458 offdiag_y: 0.0_f32,
18459 offdiag_z: 0.0_f32,
18460 compass_id: 0_u8,
18461 cal_mask: 0_u8,
18462 cal_status: MagCalStatus::DEFAULT,
18463 autosaved: 0_u8,
18464 orientation_confidence: 0.0_f32,
18465 old_orientation: MavSensorOrientation::DEFAULT,
18466 new_orientation: MavSensorOrientation::DEFAULT,
18467 scale_factor: 0.0_f32,
18468 };
18469 #[cfg(feature = "arbitrary")]
18470 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18471 use arbitrary::{Arbitrary, Unstructured};
18472 let mut buf = [0u8; 1024];
18473 rng.fill_bytes(&mut buf);
18474 let mut unstructured = Unstructured::new(&buf);
18475 Self::arbitrary(&mut unstructured).unwrap_or_default()
18476 }
18477}
18478impl Default for MAG_CAL_REPORT_DATA {
18479 fn default() -> Self {
18480 Self::DEFAULT.clone()
18481 }
18482}
18483impl MessageData for MAG_CAL_REPORT_DATA {
18484 type Message = MavMessage;
18485 const ID: u32 = 192u32;
18486 const NAME: &'static str = "MAG_CAL_REPORT";
18487 const EXTRA_CRC: u8 = 36u8;
18488 const ENCODED_LEN: usize = 54usize;
18489 fn deser(
18490 _version: MavlinkVersion,
18491 __input: &[u8],
18492 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18493 let avail_len = __input.len();
18494 let mut payload_buf = [0; Self::ENCODED_LEN];
18495 let mut buf = if avail_len < Self::ENCODED_LEN {
18496 payload_buf[0..avail_len].copy_from_slice(__input);
18497 Bytes::new(&payload_buf)
18498 } else {
18499 Bytes::new(__input)
18500 };
18501 let mut __struct = Self::default();
18502 __struct.fitness = buf.get_f32_le();
18503 __struct.ofs_x = buf.get_f32_le();
18504 __struct.ofs_y = buf.get_f32_le();
18505 __struct.ofs_z = buf.get_f32_le();
18506 __struct.diag_x = buf.get_f32_le();
18507 __struct.diag_y = buf.get_f32_le();
18508 __struct.diag_z = buf.get_f32_le();
18509 __struct.offdiag_x = buf.get_f32_le();
18510 __struct.offdiag_y = buf.get_f32_le();
18511 __struct.offdiag_z = buf.get_f32_le();
18512 __struct.compass_id = buf.get_u8();
18513 __struct.cal_mask = buf.get_u8();
18514 let tmp = buf.get_u8();
18515 __struct.cal_status =
18516 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18517 enum_type: "MagCalStatus",
18518 value: tmp as u32,
18519 })?;
18520 __struct.autosaved = buf.get_u8();
18521 __struct.orientation_confidence = buf.get_f32_le();
18522 let tmp = buf.get_u8();
18523 __struct.old_orientation =
18524 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18525 enum_type: "MavSensorOrientation",
18526 value: tmp as u32,
18527 })?;
18528 let tmp = buf.get_u8();
18529 __struct.new_orientation =
18530 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18531 enum_type: "MavSensorOrientation",
18532 value: tmp as u32,
18533 })?;
18534 __struct.scale_factor = buf.get_f32_le();
18535 Ok(__struct)
18536 }
18537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18538 let mut __tmp = BytesMut::new(bytes);
18539 #[allow(clippy::absurd_extreme_comparisons)]
18540 #[allow(unused_comparisons)]
18541 if __tmp.remaining() < Self::ENCODED_LEN {
18542 panic!(
18543 "buffer is too small (need {} bytes, but got {})",
18544 Self::ENCODED_LEN,
18545 __tmp.remaining(),
18546 )
18547 }
18548 __tmp.put_f32_le(self.fitness);
18549 __tmp.put_f32_le(self.ofs_x);
18550 __tmp.put_f32_le(self.ofs_y);
18551 __tmp.put_f32_le(self.ofs_z);
18552 __tmp.put_f32_le(self.diag_x);
18553 __tmp.put_f32_le(self.diag_y);
18554 __tmp.put_f32_le(self.diag_z);
18555 __tmp.put_f32_le(self.offdiag_x);
18556 __tmp.put_f32_le(self.offdiag_y);
18557 __tmp.put_f32_le(self.offdiag_z);
18558 __tmp.put_u8(self.compass_id);
18559 __tmp.put_u8(self.cal_mask);
18560 __tmp.put_u8(self.cal_status as u8);
18561 __tmp.put_u8(self.autosaved);
18562 if matches!(version, MavlinkVersion::V2) {
18563 __tmp.put_f32_le(self.orientation_confidence);
18564 __tmp.put_u8(self.old_orientation as u8);
18565 __tmp.put_u8(self.new_orientation as u8);
18566 __tmp.put_f32_le(self.scale_factor);
18567 let len = __tmp.len();
18568 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18569 } else {
18570 __tmp.len()
18571 }
18572 }
18573}
18574#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18575#[doc = ""]
18576#[doc = "ID: 69"]
18577#[derive(Debug, Clone, PartialEq)]
18578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18580pub struct MANUAL_CONTROL_DATA {
18581 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18582 pub x: i16,
18583 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18584 pub y: i16,
18585 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18586 pub z: i16,
18587 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18588 pub r: i16,
18589 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18590 pub buttons: u16,
18591 #[doc = "The system to be controlled."]
18592 pub target: u8,
18593 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18594 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18595 pub buttons2: u16,
18596 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18597 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18598 pub enabled_extensions: u8,
18599 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18600 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18601 pub s: i16,
18602 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18603 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18604 pub t: i16,
18605 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18606 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18607 pub aux1: i16,
18608 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18609 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18610 pub aux2: i16,
18611 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18612 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18613 pub aux3: i16,
18614 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18615 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18616 pub aux4: i16,
18617 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18618 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18619 pub aux5: i16,
18620 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18621 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18622 pub aux6: i16,
18623}
18624impl MANUAL_CONTROL_DATA {
18625 pub const ENCODED_LEN: usize = 30usize;
18626 pub const DEFAULT: Self = Self {
18627 x: 0_i16,
18628 y: 0_i16,
18629 z: 0_i16,
18630 r: 0_i16,
18631 buttons: 0_u16,
18632 target: 0_u8,
18633 buttons2: 0_u16,
18634 enabled_extensions: 0_u8,
18635 s: 0_i16,
18636 t: 0_i16,
18637 aux1: 0_i16,
18638 aux2: 0_i16,
18639 aux3: 0_i16,
18640 aux4: 0_i16,
18641 aux5: 0_i16,
18642 aux6: 0_i16,
18643 };
18644 #[cfg(feature = "arbitrary")]
18645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18646 use arbitrary::{Arbitrary, Unstructured};
18647 let mut buf = [0u8; 1024];
18648 rng.fill_bytes(&mut buf);
18649 let mut unstructured = Unstructured::new(&buf);
18650 Self::arbitrary(&mut unstructured).unwrap_or_default()
18651 }
18652}
18653impl Default for MANUAL_CONTROL_DATA {
18654 fn default() -> Self {
18655 Self::DEFAULT.clone()
18656 }
18657}
18658impl MessageData for MANUAL_CONTROL_DATA {
18659 type Message = MavMessage;
18660 const ID: u32 = 69u32;
18661 const NAME: &'static str = "MANUAL_CONTROL";
18662 const EXTRA_CRC: u8 = 243u8;
18663 const ENCODED_LEN: usize = 30usize;
18664 fn deser(
18665 _version: MavlinkVersion,
18666 __input: &[u8],
18667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18668 let avail_len = __input.len();
18669 let mut payload_buf = [0; Self::ENCODED_LEN];
18670 let mut buf = if avail_len < Self::ENCODED_LEN {
18671 payload_buf[0..avail_len].copy_from_slice(__input);
18672 Bytes::new(&payload_buf)
18673 } else {
18674 Bytes::new(__input)
18675 };
18676 let mut __struct = Self::default();
18677 __struct.x = buf.get_i16_le();
18678 __struct.y = buf.get_i16_le();
18679 __struct.z = buf.get_i16_le();
18680 __struct.r = buf.get_i16_le();
18681 __struct.buttons = buf.get_u16_le();
18682 __struct.target = buf.get_u8();
18683 __struct.buttons2 = buf.get_u16_le();
18684 __struct.enabled_extensions = buf.get_u8();
18685 __struct.s = buf.get_i16_le();
18686 __struct.t = buf.get_i16_le();
18687 __struct.aux1 = buf.get_i16_le();
18688 __struct.aux2 = buf.get_i16_le();
18689 __struct.aux3 = buf.get_i16_le();
18690 __struct.aux4 = buf.get_i16_le();
18691 __struct.aux5 = buf.get_i16_le();
18692 __struct.aux6 = buf.get_i16_le();
18693 Ok(__struct)
18694 }
18695 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18696 let mut __tmp = BytesMut::new(bytes);
18697 #[allow(clippy::absurd_extreme_comparisons)]
18698 #[allow(unused_comparisons)]
18699 if __tmp.remaining() < Self::ENCODED_LEN {
18700 panic!(
18701 "buffer is too small (need {} bytes, but got {})",
18702 Self::ENCODED_LEN,
18703 __tmp.remaining(),
18704 )
18705 }
18706 __tmp.put_i16_le(self.x);
18707 __tmp.put_i16_le(self.y);
18708 __tmp.put_i16_le(self.z);
18709 __tmp.put_i16_le(self.r);
18710 __tmp.put_u16_le(self.buttons);
18711 __tmp.put_u8(self.target);
18712 if matches!(version, MavlinkVersion::V2) {
18713 __tmp.put_u16_le(self.buttons2);
18714 __tmp.put_u8(self.enabled_extensions);
18715 __tmp.put_i16_le(self.s);
18716 __tmp.put_i16_le(self.t);
18717 __tmp.put_i16_le(self.aux1);
18718 __tmp.put_i16_le(self.aux2);
18719 __tmp.put_i16_le(self.aux3);
18720 __tmp.put_i16_le(self.aux4);
18721 __tmp.put_i16_le(self.aux5);
18722 __tmp.put_i16_le(self.aux6);
18723 let len = __tmp.len();
18724 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18725 } else {
18726 __tmp.len()
18727 }
18728 }
18729}
18730#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18731#[doc = ""]
18732#[doc = "ID: 81"]
18733#[derive(Debug, Clone, PartialEq)]
18734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18736pub struct MANUAL_SETPOINT_DATA {
18737 #[doc = "Timestamp (time since system boot)."]
18738 pub time_boot_ms: u32,
18739 #[doc = "Desired roll rate"]
18740 pub roll: f32,
18741 #[doc = "Desired pitch rate"]
18742 pub pitch: f32,
18743 #[doc = "Desired yaw rate"]
18744 pub yaw: f32,
18745 #[doc = "Collective thrust, normalized to 0 .. 1"]
18746 pub thrust: f32,
18747 #[doc = "Flight mode switch position, 0.. 255"]
18748 pub mode_switch: u8,
18749 #[doc = "Override mode switch position, 0.. 255"]
18750 pub manual_override_switch: u8,
18751}
18752impl MANUAL_SETPOINT_DATA {
18753 pub const ENCODED_LEN: usize = 22usize;
18754 pub const DEFAULT: Self = Self {
18755 time_boot_ms: 0_u32,
18756 roll: 0.0_f32,
18757 pitch: 0.0_f32,
18758 yaw: 0.0_f32,
18759 thrust: 0.0_f32,
18760 mode_switch: 0_u8,
18761 manual_override_switch: 0_u8,
18762 };
18763 #[cfg(feature = "arbitrary")]
18764 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18765 use arbitrary::{Arbitrary, Unstructured};
18766 let mut buf = [0u8; 1024];
18767 rng.fill_bytes(&mut buf);
18768 let mut unstructured = Unstructured::new(&buf);
18769 Self::arbitrary(&mut unstructured).unwrap_or_default()
18770 }
18771}
18772impl Default for MANUAL_SETPOINT_DATA {
18773 fn default() -> Self {
18774 Self::DEFAULT.clone()
18775 }
18776}
18777impl MessageData for MANUAL_SETPOINT_DATA {
18778 type Message = MavMessage;
18779 const ID: u32 = 81u32;
18780 const NAME: &'static str = "MANUAL_SETPOINT";
18781 const EXTRA_CRC: u8 = 106u8;
18782 const ENCODED_LEN: usize = 22usize;
18783 fn deser(
18784 _version: MavlinkVersion,
18785 __input: &[u8],
18786 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18787 let avail_len = __input.len();
18788 let mut payload_buf = [0; Self::ENCODED_LEN];
18789 let mut buf = if avail_len < Self::ENCODED_LEN {
18790 payload_buf[0..avail_len].copy_from_slice(__input);
18791 Bytes::new(&payload_buf)
18792 } else {
18793 Bytes::new(__input)
18794 };
18795 let mut __struct = Self::default();
18796 __struct.time_boot_ms = buf.get_u32_le();
18797 __struct.roll = buf.get_f32_le();
18798 __struct.pitch = buf.get_f32_le();
18799 __struct.yaw = buf.get_f32_le();
18800 __struct.thrust = buf.get_f32_le();
18801 __struct.mode_switch = buf.get_u8();
18802 __struct.manual_override_switch = buf.get_u8();
18803 Ok(__struct)
18804 }
18805 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18806 let mut __tmp = BytesMut::new(bytes);
18807 #[allow(clippy::absurd_extreme_comparisons)]
18808 #[allow(unused_comparisons)]
18809 if __tmp.remaining() < Self::ENCODED_LEN {
18810 panic!(
18811 "buffer is too small (need {} bytes, but got {})",
18812 Self::ENCODED_LEN,
18813 __tmp.remaining(),
18814 )
18815 }
18816 __tmp.put_u32_le(self.time_boot_ms);
18817 __tmp.put_f32_le(self.roll);
18818 __tmp.put_f32_le(self.pitch);
18819 __tmp.put_f32_le(self.yaw);
18820 __tmp.put_f32_le(self.thrust);
18821 __tmp.put_u8(self.mode_switch);
18822 __tmp.put_u8(self.manual_override_switch);
18823 if matches!(version, MavlinkVersion::V2) {
18824 let len = __tmp.len();
18825 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18826 } else {
18827 __tmp.len()
18828 }
18829 }
18830}
18831#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18832#[doc = ""]
18833#[doc = "ID: 249"]
18834#[derive(Debug, Clone, PartialEq)]
18835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18837pub struct MEMORY_VECT_DATA {
18838 #[doc = "Starting address of the debug variables"]
18839 pub address: u16,
18840 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18841 pub ver: u8,
18842 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18843 pub mavtype: u8,
18844 #[doc = "Memory contents at specified address"]
18845 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18846 pub value: [i8; 32],
18847}
18848impl MEMORY_VECT_DATA {
18849 pub const ENCODED_LEN: usize = 36usize;
18850 pub const DEFAULT: Self = Self {
18851 address: 0_u16,
18852 ver: 0_u8,
18853 mavtype: 0_u8,
18854 value: [0_i8; 32usize],
18855 };
18856 #[cfg(feature = "arbitrary")]
18857 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18858 use arbitrary::{Arbitrary, Unstructured};
18859 let mut buf = [0u8; 1024];
18860 rng.fill_bytes(&mut buf);
18861 let mut unstructured = Unstructured::new(&buf);
18862 Self::arbitrary(&mut unstructured).unwrap_or_default()
18863 }
18864}
18865impl Default for MEMORY_VECT_DATA {
18866 fn default() -> Self {
18867 Self::DEFAULT.clone()
18868 }
18869}
18870impl MessageData for MEMORY_VECT_DATA {
18871 type Message = MavMessage;
18872 const ID: u32 = 249u32;
18873 const NAME: &'static str = "MEMORY_VECT";
18874 const EXTRA_CRC: u8 = 204u8;
18875 const ENCODED_LEN: usize = 36usize;
18876 fn deser(
18877 _version: MavlinkVersion,
18878 __input: &[u8],
18879 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18880 let avail_len = __input.len();
18881 let mut payload_buf = [0; Self::ENCODED_LEN];
18882 let mut buf = if avail_len < Self::ENCODED_LEN {
18883 payload_buf[0..avail_len].copy_from_slice(__input);
18884 Bytes::new(&payload_buf)
18885 } else {
18886 Bytes::new(__input)
18887 };
18888 let mut __struct = Self::default();
18889 __struct.address = buf.get_u16_le();
18890 __struct.ver = buf.get_u8();
18891 __struct.mavtype = buf.get_u8();
18892 for v in &mut __struct.value {
18893 let val = buf.get_i8();
18894 *v = val;
18895 }
18896 Ok(__struct)
18897 }
18898 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18899 let mut __tmp = BytesMut::new(bytes);
18900 #[allow(clippy::absurd_extreme_comparisons)]
18901 #[allow(unused_comparisons)]
18902 if __tmp.remaining() < Self::ENCODED_LEN {
18903 panic!(
18904 "buffer is too small (need {} bytes, but got {})",
18905 Self::ENCODED_LEN,
18906 __tmp.remaining(),
18907 )
18908 }
18909 __tmp.put_u16_le(self.address);
18910 __tmp.put_u8(self.ver);
18911 __tmp.put_u8(self.mavtype);
18912 for val in &self.value {
18913 __tmp.put_i8(*val);
18914 }
18915 if matches!(version, MavlinkVersion::V2) {
18916 let len = __tmp.len();
18917 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18918 } else {
18919 __tmp.len()
18920 }
18921 }
18922}
18923#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
18924#[doc = ""]
18925#[doc = "ID: 244"]
18926#[derive(Debug, Clone, PartialEq)]
18927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18929pub struct MESSAGE_INTERVAL_DATA {
18930 #[doc = "0 indicates the interval at which it is sent."]
18931 pub interval_us: i32,
18932 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
18933 pub message_id: u16,
18934}
18935impl MESSAGE_INTERVAL_DATA {
18936 pub const ENCODED_LEN: usize = 6usize;
18937 pub const DEFAULT: Self = Self {
18938 interval_us: 0_i32,
18939 message_id: 0_u16,
18940 };
18941 #[cfg(feature = "arbitrary")]
18942 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18943 use arbitrary::{Arbitrary, Unstructured};
18944 let mut buf = [0u8; 1024];
18945 rng.fill_bytes(&mut buf);
18946 let mut unstructured = Unstructured::new(&buf);
18947 Self::arbitrary(&mut unstructured).unwrap_or_default()
18948 }
18949}
18950impl Default for MESSAGE_INTERVAL_DATA {
18951 fn default() -> Self {
18952 Self::DEFAULT.clone()
18953 }
18954}
18955impl MessageData for MESSAGE_INTERVAL_DATA {
18956 type Message = MavMessage;
18957 const ID: u32 = 244u32;
18958 const NAME: &'static str = "MESSAGE_INTERVAL";
18959 const EXTRA_CRC: u8 = 95u8;
18960 const ENCODED_LEN: usize = 6usize;
18961 fn deser(
18962 _version: MavlinkVersion,
18963 __input: &[u8],
18964 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18965 let avail_len = __input.len();
18966 let mut payload_buf = [0; Self::ENCODED_LEN];
18967 let mut buf = if avail_len < Self::ENCODED_LEN {
18968 payload_buf[0..avail_len].copy_from_slice(__input);
18969 Bytes::new(&payload_buf)
18970 } else {
18971 Bytes::new(__input)
18972 };
18973 let mut __struct = Self::default();
18974 __struct.interval_us = buf.get_i32_le();
18975 __struct.message_id = buf.get_u16_le();
18976 Ok(__struct)
18977 }
18978 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18979 let mut __tmp = BytesMut::new(bytes);
18980 #[allow(clippy::absurd_extreme_comparisons)]
18981 #[allow(unused_comparisons)]
18982 if __tmp.remaining() < Self::ENCODED_LEN {
18983 panic!(
18984 "buffer is too small (need {} bytes, but got {})",
18985 Self::ENCODED_LEN,
18986 __tmp.remaining(),
18987 )
18988 }
18989 __tmp.put_i32_le(self.interval_us);
18990 __tmp.put_u16_le(self.message_id);
18991 if matches!(version, MavlinkVersion::V2) {
18992 let len = __tmp.len();
18993 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18994 } else {
18995 __tmp.len()
18996 }
18997 }
18998}
18999#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19000#[doc = ""]
19001#[doc = "ID: 47"]
19002#[derive(Debug, Clone, PartialEq)]
19003#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19004#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19005pub struct MISSION_ACK_DATA {
19006 #[doc = "System ID"]
19007 pub target_system: u8,
19008 #[doc = "Component ID"]
19009 pub target_component: u8,
19010 #[doc = "Mission result."]
19011 pub mavtype: MavMissionResult,
19012 #[doc = "Mission type."]
19013 #[cfg_attr(feature = "serde", serde(default))]
19014 pub mission_type: MavMissionType,
19015 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19016 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19017 pub opaque_id: u32,
19018}
19019impl MISSION_ACK_DATA {
19020 pub const ENCODED_LEN: usize = 8usize;
19021 pub const DEFAULT: Self = Self {
19022 target_system: 0_u8,
19023 target_component: 0_u8,
19024 mavtype: MavMissionResult::DEFAULT,
19025 mission_type: MavMissionType::DEFAULT,
19026 opaque_id: 0_u32,
19027 };
19028 #[cfg(feature = "arbitrary")]
19029 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19030 use arbitrary::{Arbitrary, Unstructured};
19031 let mut buf = [0u8; 1024];
19032 rng.fill_bytes(&mut buf);
19033 let mut unstructured = Unstructured::new(&buf);
19034 Self::arbitrary(&mut unstructured).unwrap_or_default()
19035 }
19036}
19037impl Default for MISSION_ACK_DATA {
19038 fn default() -> Self {
19039 Self::DEFAULT.clone()
19040 }
19041}
19042impl MessageData for MISSION_ACK_DATA {
19043 type Message = MavMessage;
19044 const ID: u32 = 47u32;
19045 const NAME: &'static str = "MISSION_ACK";
19046 const EXTRA_CRC: u8 = 153u8;
19047 const ENCODED_LEN: usize = 8usize;
19048 fn deser(
19049 _version: MavlinkVersion,
19050 __input: &[u8],
19051 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19052 let avail_len = __input.len();
19053 let mut payload_buf = [0; Self::ENCODED_LEN];
19054 let mut buf = if avail_len < Self::ENCODED_LEN {
19055 payload_buf[0..avail_len].copy_from_slice(__input);
19056 Bytes::new(&payload_buf)
19057 } else {
19058 Bytes::new(__input)
19059 };
19060 let mut __struct = Self::default();
19061 __struct.target_system = buf.get_u8();
19062 __struct.target_component = buf.get_u8();
19063 let tmp = buf.get_u8();
19064 __struct.mavtype =
19065 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19066 enum_type: "MavMissionResult",
19067 value: tmp as u32,
19068 })?;
19069 let tmp = buf.get_u8();
19070 __struct.mission_type =
19071 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19072 enum_type: "MavMissionType",
19073 value: tmp as u32,
19074 })?;
19075 __struct.opaque_id = buf.get_u32_le();
19076 Ok(__struct)
19077 }
19078 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19079 let mut __tmp = BytesMut::new(bytes);
19080 #[allow(clippy::absurd_extreme_comparisons)]
19081 #[allow(unused_comparisons)]
19082 if __tmp.remaining() < Self::ENCODED_LEN {
19083 panic!(
19084 "buffer is too small (need {} bytes, but got {})",
19085 Self::ENCODED_LEN,
19086 __tmp.remaining(),
19087 )
19088 }
19089 __tmp.put_u8(self.target_system);
19090 __tmp.put_u8(self.target_component);
19091 __tmp.put_u8(self.mavtype as u8);
19092 if matches!(version, MavlinkVersion::V2) {
19093 __tmp.put_u8(self.mission_type as u8);
19094 __tmp.put_u32_le(self.opaque_id);
19095 let len = __tmp.len();
19096 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19097 } else {
19098 __tmp.len()
19099 }
19100 }
19101}
19102#[doc = "Delete all mission items at once."]
19103#[doc = ""]
19104#[doc = "ID: 45"]
19105#[derive(Debug, Clone, PartialEq)]
19106#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19107#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19108pub struct MISSION_CLEAR_ALL_DATA {
19109 #[doc = "System ID"]
19110 pub target_system: u8,
19111 #[doc = "Component ID"]
19112 pub target_component: u8,
19113 #[doc = "Mission type."]
19114 #[cfg_attr(feature = "serde", serde(default))]
19115 pub mission_type: MavMissionType,
19116}
19117impl MISSION_CLEAR_ALL_DATA {
19118 pub const ENCODED_LEN: usize = 3usize;
19119 pub const DEFAULT: Self = Self {
19120 target_system: 0_u8,
19121 target_component: 0_u8,
19122 mission_type: MavMissionType::DEFAULT,
19123 };
19124 #[cfg(feature = "arbitrary")]
19125 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19126 use arbitrary::{Arbitrary, Unstructured};
19127 let mut buf = [0u8; 1024];
19128 rng.fill_bytes(&mut buf);
19129 let mut unstructured = Unstructured::new(&buf);
19130 Self::arbitrary(&mut unstructured).unwrap_or_default()
19131 }
19132}
19133impl Default for MISSION_CLEAR_ALL_DATA {
19134 fn default() -> Self {
19135 Self::DEFAULT.clone()
19136 }
19137}
19138impl MessageData for MISSION_CLEAR_ALL_DATA {
19139 type Message = MavMessage;
19140 const ID: u32 = 45u32;
19141 const NAME: &'static str = "MISSION_CLEAR_ALL";
19142 const EXTRA_CRC: u8 = 232u8;
19143 const ENCODED_LEN: usize = 3usize;
19144 fn deser(
19145 _version: MavlinkVersion,
19146 __input: &[u8],
19147 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19148 let avail_len = __input.len();
19149 let mut payload_buf = [0; Self::ENCODED_LEN];
19150 let mut buf = if avail_len < Self::ENCODED_LEN {
19151 payload_buf[0..avail_len].copy_from_slice(__input);
19152 Bytes::new(&payload_buf)
19153 } else {
19154 Bytes::new(__input)
19155 };
19156 let mut __struct = Self::default();
19157 __struct.target_system = buf.get_u8();
19158 __struct.target_component = buf.get_u8();
19159 let tmp = buf.get_u8();
19160 __struct.mission_type =
19161 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19162 enum_type: "MavMissionType",
19163 value: tmp as u32,
19164 })?;
19165 Ok(__struct)
19166 }
19167 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19168 let mut __tmp = BytesMut::new(bytes);
19169 #[allow(clippy::absurd_extreme_comparisons)]
19170 #[allow(unused_comparisons)]
19171 if __tmp.remaining() < Self::ENCODED_LEN {
19172 panic!(
19173 "buffer is too small (need {} bytes, but got {})",
19174 Self::ENCODED_LEN,
19175 __tmp.remaining(),
19176 )
19177 }
19178 __tmp.put_u8(self.target_system);
19179 __tmp.put_u8(self.target_component);
19180 if matches!(version, MavlinkVersion::V2) {
19181 __tmp.put_u8(self.mission_type as u8);
19182 let len = __tmp.len();
19183 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19184 } else {
19185 __tmp.len()
19186 }
19187 }
19188}
19189#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19190#[doc = ""]
19191#[doc = "ID: 44"]
19192#[derive(Debug, Clone, PartialEq)]
19193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19194#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19195pub struct MISSION_COUNT_DATA {
19196 #[doc = "Number of mission items in the sequence"]
19197 pub count: u16,
19198 #[doc = "System ID"]
19199 pub target_system: u8,
19200 #[doc = "Component ID"]
19201 pub target_component: u8,
19202 #[doc = "Mission type."]
19203 #[cfg_attr(feature = "serde", serde(default))]
19204 pub mission_type: MavMissionType,
19205 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19206 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19207 pub opaque_id: u32,
19208}
19209impl MISSION_COUNT_DATA {
19210 pub const ENCODED_LEN: usize = 9usize;
19211 pub const DEFAULT: Self = Self {
19212 count: 0_u16,
19213 target_system: 0_u8,
19214 target_component: 0_u8,
19215 mission_type: MavMissionType::DEFAULT,
19216 opaque_id: 0_u32,
19217 };
19218 #[cfg(feature = "arbitrary")]
19219 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19220 use arbitrary::{Arbitrary, Unstructured};
19221 let mut buf = [0u8; 1024];
19222 rng.fill_bytes(&mut buf);
19223 let mut unstructured = Unstructured::new(&buf);
19224 Self::arbitrary(&mut unstructured).unwrap_or_default()
19225 }
19226}
19227impl Default for MISSION_COUNT_DATA {
19228 fn default() -> Self {
19229 Self::DEFAULT.clone()
19230 }
19231}
19232impl MessageData for MISSION_COUNT_DATA {
19233 type Message = MavMessage;
19234 const ID: u32 = 44u32;
19235 const NAME: &'static str = "MISSION_COUNT";
19236 const EXTRA_CRC: u8 = 221u8;
19237 const ENCODED_LEN: usize = 9usize;
19238 fn deser(
19239 _version: MavlinkVersion,
19240 __input: &[u8],
19241 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19242 let avail_len = __input.len();
19243 let mut payload_buf = [0; Self::ENCODED_LEN];
19244 let mut buf = if avail_len < Self::ENCODED_LEN {
19245 payload_buf[0..avail_len].copy_from_slice(__input);
19246 Bytes::new(&payload_buf)
19247 } else {
19248 Bytes::new(__input)
19249 };
19250 let mut __struct = Self::default();
19251 __struct.count = buf.get_u16_le();
19252 __struct.target_system = buf.get_u8();
19253 __struct.target_component = buf.get_u8();
19254 let tmp = buf.get_u8();
19255 __struct.mission_type =
19256 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19257 enum_type: "MavMissionType",
19258 value: tmp as u32,
19259 })?;
19260 __struct.opaque_id = buf.get_u32_le();
19261 Ok(__struct)
19262 }
19263 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19264 let mut __tmp = BytesMut::new(bytes);
19265 #[allow(clippy::absurd_extreme_comparisons)]
19266 #[allow(unused_comparisons)]
19267 if __tmp.remaining() < Self::ENCODED_LEN {
19268 panic!(
19269 "buffer is too small (need {} bytes, but got {})",
19270 Self::ENCODED_LEN,
19271 __tmp.remaining(),
19272 )
19273 }
19274 __tmp.put_u16_le(self.count);
19275 __tmp.put_u8(self.target_system);
19276 __tmp.put_u8(self.target_component);
19277 if matches!(version, MavlinkVersion::V2) {
19278 __tmp.put_u8(self.mission_type as u8);
19279 __tmp.put_u32_le(self.opaque_id);
19280 let len = __tmp.len();
19281 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19282 } else {
19283 __tmp.len()
19284 }
19285 }
19286}
19287#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19288#[doc = ""]
19289#[doc = "ID: 42"]
19290#[derive(Debug, Clone, PartialEq)]
19291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19292#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19293pub struct MISSION_CURRENT_DATA {
19294 #[doc = "Sequence"]
19295 pub seq: u16,
19296 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19297 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19298 pub total: u16,
19299 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19300 #[cfg_attr(feature = "serde", serde(default))]
19301 pub mission_state: MissionState,
19302 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19303 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19304 pub mission_mode: u8,
19305 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19306 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19307 pub mission_id: u32,
19308 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19309 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19310 pub fence_id: u32,
19311 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19312 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19313 pub rally_points_id: u32,
19314}
19315impl MISSION_CURRENT_DATA {
19316 pub const ENCODED_LEN: usize = 18usize;
19317 pub const DEFAULT: Self = Self {
19318 seq: 0_u16,
19319 total: 0_u16,
19320 mission_state: MissionState::DEFAULT,
19321 mission_mode: 0_u8,
19322 mission_id: 0_u32,
19323 fence_id: 0_u32,
19324 rally_points_id: 0_u32,
19325 };
19326 #[cfg(feature = "arbitrary")]
19327 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19328 use arbitrary::{Arbitrary, Unstructured};
19329 let mut buf = [0u8; 1024];
19330 rng.fill_bytes(&mut buf);
19331 let mut unstructured = Unstructured::new(&buf);
19332 Self::arbitrary(&mut unstructured).unwrap_or_default()
19333 }
19334}
19335impl Default for MISSION_CURRENT_DATA {
19336 fn default() -> Self {
19337 Self::DEFAULT.clone()
19338 }
19339}
19340impl MessageData for MISSION_CURRENT_DATA {
19341 type Message = MavMessage;
19342 const ID: u32 = 42u32;
19343 const NAME: &'static str = "MISSION_CURRENT";
19344 const EXTRA_CRC: u8 = 28u8;
19345 const ENCODED_LEN: usize = 18usize;
19346 fn deser(
19347 _version: MavlinkVersion,
19348 __input: &[u8],
19349 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19350 let avail_len = __input.len();
19351 let mut payload_buf = [0; Self::ENCODED_LEN];
19352 let mut buf = if avail_len < Self::ENCODED_LEN {
19353 payload_buf[0..avail_len].copy_from_slice(__input);
19354 Bytes::new(&payload_buf)
19355 } else {
19356 Bytes::new(__input)
19357 };
19358 let mut __struct = Self::default();
19359 __struct.seq = buf.get_u16_le();
19360 __struct.total = buf.get_u16_le();
19361 let tmp = buf.get_u8();
19362 __struct.mission_state =
19363 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19364 enum_type: "MissionState",
19365 value: tmp as u32,
19366 })?;
19367 __struct.mission_mode = buf.get_u8();
19368 __struct.mission_id = buf.get_u32_le();
19369 __struct.fence_id = buf.get_u32_le();
19370 __struct.rally_points_id = buf.get_u32_le();
19371 Ok(__struct)
19372 }
19373 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19374 let mut __tmp = BytesMut::new(bytes);
19375 #[allow(clippy::absurd_extreme_comparisons)]
19376 #[allow(unused_comparisons)]
19377 if __tmp.remaining() < Self::ENCODED_LEN {
19378 panic!(
19379 "buffer is too small (need {} bytes, but got {})",
19380 Self::ENCODED_LEN,
19381 __tmp.remaining(),
19382 )
19383 }
19384 __tmp.put_u16_le(self.seq);
19385 if matches!(version, MavlinkVersion::V2) {
19386 __tmp.put_u16_le(self.total);
19387 __tmp.put_u8(self.mission_state as u8);
19388 __tmp.put_u8(self.mission_mode);
19389 __tmp.put_u32_le(self.mission_id);
19390 __tmp.put_u32_le(self.fence_id);
19391 __tmp.put_u32_le(self.rally_points_id);
19392 let len = __tmp.len();
19393 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19394 } else {
19395 __tmp.len()
19396 }
19397 }
19398}
19399#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19400#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19401#[doc = ""]
19402#[doc = "ID: 39"]
19403#[derive(Debug, Clone, PartialEq)]
19404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19406pub struct MISSION_ITEM_DATA {
19407 #[doc = "PARAM1, see MAV_CMD enum"]
19408 pub param1: f32,
19409 #[doc = "PARAM2, see MAV_CMD enum"]
19410 pub param2: f32,
19411 #[doc = "PARAM3, see MAV_CMD enum"]
19412 pub param3: f32,
19413 #[doc = "PARAM4, see MAV_CMD enum"]
19414 pub param4: f32,
19415 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19416 pub x: f32,
19417 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19418 pub y: f32,
19419 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19420 pub z: f32,
19421 #[doc = "Sequence"]
19422 pub seq: u16,
19423 #[doc = "The scheduled action for the waypoint."]
19424 pub command: MavCmd,
19425 #[doc = "System ID"]
19426 pub target_system: u8,
19427 #[doc = "Component ID"]
19428 pub target_component: u8,
19429 #[doc = "The coordinate system of the waypoint."]
19430 pub frame: MavFrame,
19431 #[doc = "false:0, true:1"]
19432 pub current: u8,
19433 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19434 pub autocontinue: u8,
19435 #[doc = "Mission type."]
19436 #[cfg_attr(feature = "serde", serde(default))]
19437 pub mission_type: MavMissionType,
19438}
19439impl MISSION_ITEM_DATA {
19440 pub const ENCODED_LEN: usize = 38usize;
19441 pub const DEFAULT: Self = Self {
19442 param1: 0.0_f32,
19443 param2: 0.0_f32,
19444 param3: 0.0_f32,
19445 param4: 0.0_f32,
19446 x: 0.0_f32,
19447 y: 0.0_f32,
19448 z: 0.0_f32,
19449 seq: 0_u16,
19450 command: MavCmd::DEFAULT,
19451 target_system: 0_u8,
19452 target_component: 0_u8,
19453 frame: MavFrame::DEFAULT,
19454 current: 0_u8,
19455 autocontinue: 0_u8,
19456 mission_type: MavMissionType::DEFAULT,
19457 };
19458 #[cfg(feature = "arbitrary")]
19459 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19460 use arbitrary::{Arbitrary, Unstructured};
19461 let mut buf = [0u8; 1024];
19462 rng.fill_bytes(&mut buf);
19463 let mut unstructured = Unstructured::new(&buf);
19464 Self::arbitrary(&mut unstructured).unwrap_or_default()
19465 }
19466}
19467impl Default for MISSION_ITEM_DATA {
19468 fn default() -> Self {
19469 Self::DEFAULT.clone()
19470 }
19471}
19472impl MessageData for MISSION_ITEM_DATA {
19473 type Message = MavMessage;
19474 const ID: u32 = 39u32;
19475 const NAME: &'static str = "MISSION_ITEM";
19476 const EXTRA_CRC: u8 = 254u8;
19477 const ENCODED_LEN: usize = 38usize;
19478 fn deser(
19479 _version: MavlinkVersion,
19480 __input: &[u8],
19481 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19482 let avail_len = __input.len();
19483 let mut payload_buf = [0; Self::ENCODED_LEN];
19484 let mut buf = if avail_len < Self::ENCODED_LEN {
19485 payload_buf[0..avail_len].copy_from_slice(__input);
19486 Bytes::new(&payload_buf)
19487 } else {
19488 Bytes::new(__input)
19489 };
19490 let mut __struct = Self::default();
19491 __struct.param1 = buf.get_f32_le();
19492 __struct.param2 = buf.get_f32_le();
19493 __struct.param3 = buf.get_f32_le();
19494 __struct.param4 = buf.get_f32_le();
19495 __struct.x = buf.get_f32_le();
19496 __struct.y = buf.get_f32_le();
19497 __struct.z = buf.get_f32_le();
19498 __struct.seq = buf.get_u16_le();
19499 let tmp = buf.get_u16_le();
19500 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19501 ::mavlink_core::error::ParserError::InvalidEnum {
19502 enum_type: "MavCmd",
19503 value: tmp as u32,
19504 },
19505 )?;
19506 __struct.target_system = buf.get_u8();
19507 __struct.target_component = buf.get_u8();
19508 let tmp = buf.get_u8();
19509 __struct.frame =
19510 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19511 enum_type: "MavFrame",
19512 value: tmp as u32,
19513 })?;
19514 __struct.current = buf.get_u8();
19515 __struct.autocontinue = buf.get_u8();
19516 let tmp = buf.get_u8();
19517 __struct.mission_type =
19518 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19519 enum_type: "MavMissionType",
19520 value: tmp as u32,
19521 })?;
19522 Ok(__struct)
19523 }
19524 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19525 let mut __tmp = BytesMut::new(bytes);
19526 #[allow(clippy::absurd_extreme_comparisons)]
19527 #[allow(unused_comparisons)]
19528 if __tmp.remaining() < Self::ENCODED_LEN {
19529 panic!(
19530 "buffer is too small (need {} bytes, but got {})",
19531 Self::ENCODED_LEN,
19532 __tmp.remaining(),
19533 )
19534 }
19535 __tmp.put_f32_le(self.param1);
19536 __tmp.put_f32_le(self.param2);
19537 __tmp.put_f32_le(self.param3);
19538 __tmp.put_f32_le(self.param4);
19539 __tmp.put_f32_le(self.x);
19540 __tmp.put_f32_le(self.y);
19541 __tmp.put_f32_le(self.z);
19542 __tmp.put_u16_le(self.seq);
19543 __tmp.put_u16_le(self.command as u16);
19544 __tmp.put_u8(self.target_system);
19545 __tmp.put_u8(self.target_component);
19546 __tmp.put_u8(self.frame as u8);
19547 __tmp.put_u8(self.current);
19548 __tmp.put_u8(self.autocontinue);
19549 if matches!(version, MavlinkVersion::V2) {
19550 __tmp.put_u8(self.mission_type as u8);
19551 let len = __tmp.len();
19552 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19553 } else {
19554 __tmp.len()
19555 }
19556 }
19557}
19558#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19559#[doc = ""]
19560#[doc = "ID: 73"]
19561#[derive(Debug, Clone, PartialEq)]
19562#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19563#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19564pub struct MISSION_ITEM_INT_DATA {
19565 #[doc = "PARAM1, see MAV_CMD enum"]
19566 pub param1: f32,
19567 #[doc = "PARAM2, see MAV_CMD enum"]
19568 pub param2: f32,
19569 #[doc = "PARAM3, see MAV_CMD enum"]
19570 pub param3: f32,
19571 #[doc = "PARAM4, see MAV_CMD enum"]
19572 pub param4: f32,
19573 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19574 pub x: i32,
19575 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19576 pub y: i32,
19577 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19578 pub z: f32,
19579 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19580 pub seq: u16,
19581 #[doc = "The scheduled action for the waypoint."]
19582 pub command: MavCmd,
19583 #[doc = "System ID"]
19584 pub target_system: u8,
19585 #[doc = "Component ID"]
19586 pub target_component: u8,
19587 #[doc = "The coordinate system of the waypoint."]
19588 pub frame: MavFrame,
19589 #[doc = "false:0, true:1"]
19590 pub current: u8,
19591 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19592 pub autocontinue: u8,
19593 #[doc = "Mission type."]
19594 #[cfg_attr(feature = "serde", serde(default))]
19595 pub mission_type: MavMissionType,
19596}
19597impl MISSION_ITEM_INT_DATA {
19598 pub const ENCODED_LEN: usize = 38usize;
19599 pub const DEFAULT: Self = Self {
19600 param1: 0.0_f32,
19601 param2: 0.0_f32,
19602 param3: 0.0_f32,
19603 param4: 0.0_f32,
19604 x: 0_i32,
19605 y: 0_i32,
19606 z: 0.0_f32,
19607 seq: 0_u16,
19608 command: MavCmd::DEFAULT,
19609 target_system: 0_u8,
19610 target_component: 0_u8,
19611 frame: MavFrame::DEFAULT,
19612 current: 0_u8,
19613 autocontinue: 0_u8,
19614 mission_type: MavMissionType::DEFAULT,
19615 };
19616 #[cfg(feature = "arbitrary")]
19617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19618 use arbitrary::{Arbitrary, Unstructured};
19619 let mut buf = [0u8; 1024];
19620 rng.fill_bytes(&mut buf);
19621 let mut unstructured = Unstructured::new(&buf);
19622 Self::arbitrary(&mut unstructured).unwrap_or_default()
19623 }
19624}
19625impl Default for MISSION_ITEM_INT_DATA {
19626 fn default() -> Self {
19627 Self::DEFAULT.clone()
19628 }
19629}
19630impl MessageData for MISSION_ITEM_INT_DATA {
19631 type Message = MavMessage;
19632 const ID: u32 = 73u32;
19633 const NAME: &'static str = "MISSION_ITEM_INT";
19634 const EXTRA_CRC: u8 = 38u8;
19635 const ENCODED_LEN: usize = 38usize;
19636 fn deser(
19637 _version: MavlinkVersion,
19638 __input: &[u8],
19639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19640 let avail_len = __input.len();
19641 let mut payload_buf = [0; Self::ENCODED_LEN];
19642 let mut buf = if avail_len < Self::ENCODED_LEN {
19643 payload_buf[0..avail_len].copy_from_slice(__input);
19644 Bytes::new(&payload_buf)
19645 } else {
19646 Bytes::new(__input)
19647 };
19648 let mut __struct = Self::default();
19649 __struct.param1 = buf.get_f32_le();
19650 __struct.param2 = buf.get_f32_le();
19651 __struct.param3 = buf.get_f32_le();
19652 __struct.param4 = buf.get_f32_le();
19653 __struct.x = buf.get_i32_le();
19654 __struct.y = buf.get_i32_le();
19655 __struct.z = buf.get_f32_le();
19656 __struct.seq = buf.get_u16_le();
19657 let tmp = buf.get_u16_le();
19658 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19659 ::mavlink_core::error::ParserError::InvalidEnum {
19660 enum_type: "MavCmd",
19661 value: tmp as u32,
19662 },
19663 )?;
19664 __struct.target_system = buf.get_u8();
19665 __struct.target_component = buf.get_u8();
19666 let tmp = buf.get_u8();
19667 __struct.frame =
19668 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19669 enum_type: "MavFrame",
19670 value: tmp as u32,
19671 })?;
19672 __struct.current = buf.get_u8();
19673 __struct.autocontinue = buf.get_u8();
19674 let tmp = buf.get_u8();
19675 __struct.mission_type =
19676 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19677 enum_type: "MavMissionType",
19678 value: tmp as u32,
19679 })?;
19680 Ok(__struct)
19681 }
19682 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19683 let mut __tmp = BytesMut::new(bytes);
19684 #[allow(clippy::absurd_extreme_comparisons)]
19685 #[allow(unused_comparisons)]
19686 if __tmp.remaining() < Self::ENCODED_LEN {
19687 panic!(
19688 "buffer is too small (need {} bytes, but got {})",
19689 Self::ENCODED_LEN,
19690 __tmp.remaining(),
19691 )
19692 }
19693 __tmp.put_f32_le(self.param1);
19694 __tmp.put_f32_le(self.param2);
19695 __tmp.put_f32_le(self.param3);
19696 __tmp.put_f32_le(self.param4);
19697 __tmp.put_i32_le(self.x);
19698 __tmp.put_i32_le(self.y);
19699 __tmp.put_f32_le(self.z);
19700 __tmp.put_u16_le(self.seq);
19701 __tmp.put_u16_le(self.command as u16);
19702 __tmp.put_u8(self.target_system);
19703 __tmp.put_u8(self.target_component);
19704 __tmp.put_u8(self.frame as u8);
19705 __tmp.put_u8(self.current);
19706 __tmp.put_u8(self.autocontinue);
19707 if matches!(version, MavlinkVersion::V2) {
19708 __tmp.put_u8(self.mission_type as u8);
19709 let len = __tmp.len();
19710 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19711 } else {
19712 __tmp.len()
19713 }
19714 }
19715}
19716#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19717#[doc = ""]
19718#[doc = "ID: 46"]
19719#[derive(Debug, Clone, PartialEq)]
19720#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19721#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19722pub struct MISSION_ITEM_REACHED_DATA {
19723 #[doc = "Sequence"]
19724 pub seq: u16,
19725}
19726impl MISSION_ITEM_REACHED_DATA {
19727 pub const ENCODED_LEN: usize = 2usize;
19728 pub const DEFAULT: Self = Self { seq: 0_u16 };
19729 #[cfg(feature = "arbitrary")]
19730 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19731 use arbitrary::{Arbitrary, Unstructured};
19732 let mut buf = [0u8; 1024];
19733 rng.fill_bytes(&mut buf);
19734 let mut unstructured = Unstructured::new(&buf);
19735 Self::arbitrary(&mut unstructured).unwrap_or_default()
19736 }
19737}
19738impl Default for MISSION_ITEM_REACHED_DATA {
19739 fn default() -> Self {
19740 Self::DEFAULT.clone()
19741 }
19742}
19743impl MessageData for MISSION_ITEM_REACHED_DATA {
19744 type Message = MavMessage;
19745 const ID: u32 = 46u32;
19746 const NAME: &'static str = "MISSION_ITEM_REACHED";
19747 const EXTRA_CRC: u8 = 11u8;
19748 const ENCODED_LEN: usize = 2usize;
19749 fn deser(
19750 _version: MavlinkVersion,
19751 __input: &[u8],
19752 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19753 let avail_len = __input.len();
19754 let mut payload_buf = [0; Self::ENCODED_LEN];
19755 let mut buf = if avail_len < Self::ENCODED_LEN {
19756 payload_buf[0..avail_len].copy_from_slice(__input);
19757 Bytes::new(&payload_buf)
19758 } else {
19759 Bytes::new(__input)
19760 };
19761 let mut __struct = Self::default();
19762 __struct.seq = buf.get_u16_le();
19763 Ok(__struct)
19764 }
19765 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19766 let mut __tmp = BytesMut::new(bytes);
19767 #[allow(clippy::absurd_extreme_comparisons)]
19768 #[allow(unused_comparisons)]
19769 if __tmp.remaining() < Self::ENCODED_LEN {
19770 panic!(
19771 "buffer is too small (need {} bytes, but got {})",
19772 Self::ENCODED_LEN,
19773 __tmp.remaining(),
19774 )
19775 }
19776 __tmp.put_u16_le(self.seq);
19777 if matches!(version, MavlinkVersion::V2) {
19778 let len = __tmp.len();
19779 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19780 } else {
19781 __tmp.len()
19782 }
19783 }
19784}
19785#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19786#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19787#[doc = ""]
19788#[doc = "ID: 40"]
19789#[derive(Debug, Clone, PartialEq)]
19790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19791#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19792pub struct MISSION_REQUEST_DATA {
19793 #[doc = "Sequence"]
19794 pub seq: u16,
19795 #[doc = "System ID"]
19796 pub target_system: u8,
19797 #[doc = "Component ID"]
19798 pub target_component: u8,
19799 #[doc = "Mission type."]
19800 #[cfg_attr(feature = "serde", serde(default))]
19801 pub mission_type: MavMissionType,
19802}
19803impl MISSION_REQUEST_DATA {
19804 pub const ENCODED_LEN: usize = 5usize;
19805 pub const DEFAULT: Self = Self {
19806 seq: 0_u16,
19807 target_system: 0_u8,
19808 target_component: 0_u8,
19809 mission_type: MavMissionType::DEFAULT,
19810 };
19811 #[cfg(feature = "arbitrary")]
19812 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19813 use arbitrary::{Arbitrary, Unstructured};
19814 let mut buf = [0u8; 1024];
19815 rng.fill_bytes(&mut buf);
19816 let mut unstructured = Unstructured::new(&buf);
19817 Self::arbitrary(&mut unstructured).unwrap_or_default()
19818 }
19819}
19820impl Default for MISSION_REQUEST_DATA {
19821 fn default() -> Self {
19822 Self::DEFAULT.clone()
19823 }
19824}
19825impl MessageData for MISSION_REQUEST_DATA {
19826 type Message = MavMessage;
19827 const ID: u32 = 40u32;
19828 const NAME: &'static str = "MISSION_REQUEST";
19829 const EXTRA_CRC: u8 = 230u8;
19830 const ENCODED_LEN: usize = 5usize;
19831 fn deser(
19832 _version: MavlinkVersion,
19833 __input: &[u8],
19834 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19835 let avail_len = __input.len();
19836 let mut payload_buf = [0; Self::ENCODED_LEN];
19837 let mut buf = if avail_len < Self::ENCODED_LEN {
19838 payload_buf[0..avail_len].copy_from_slice(__input);
19839 Bytes::new(&payload_buf)
19840 } else {
19841 Bytes::new(__input)
19842 };
19843 let mut __struct = Self::default();
19844 __struct.seq = buf.get_u16_le();
19845 __struct.target_system = buf.get_u8();
19846 __struct.target_component = buf.get_u8();
19847 let tmp = buf.get_u8();
19848 __struct.mission_type =
19849 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19850 enum_type: "MavMissionType",
19851 value: tmp as u32,
19852 })?;
19853 Ok(__struct)
19854 }
19855 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19856 let mut __tmp = BytesMut::new(bytes);
19857 #[allow(clippy::absurd_extreme_comparisons)]
19858 #[allow(unused_comparisons)]
19859 if __tmp.remaining() < Self::ENCODED_LEN {
19860 panic!(
19861 "buffer is too small (need {} bytes, but got {})",
19862 Self::ENCODED_LEN,
19863 __tmp.remaining(),
19864 )
19865 }
19866 __tmp.put_u16_le(self.seq);
19867 __tmp.put_u8(self.target_system);
19868 __tmp.put_u8(self.target_component);
19869 if matches!(version, MavlinkVersion::V2) {
19870 __tmp.put_u8(self.mission_type as u8);
19871 let len = __tmp.len();
19872 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19873 } else {
19874 __tmp.len()
19875 }
19876 }
19877}
19878#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
19879#[doc = ""]
19880#[doc = "ID: 51"]
19881#[derive(Debug, Clone, PartialEq)]
19882#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19883#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19884pub struct MISSION_REQUEST_INT_DATA {
19885 #[doc = "Sequence"]
19886 pub seq: u16,
19887 #[doc = "System ID"]
19888 pub target_system: u8,
19889 #[doc = "Component ID"]
19890 pub target_component: u8,
19891 #[doc = "Mission type."]
19892 #[cfg_attr(feature = "serde", serde(default))]
19893 pub mission_type: MavMissionType,
19894}
19895impl MISSION_REQUEST_INT_DATA {
19896 pub const ENCODED_LEN: usize = 5usize;
19897 pub const DEFAULT: Self = Self {
19898 seq: 0_u16,
19899 target_system: 0_u8,
19900 target_component: 0_u8,
19901 mission_type: MavMissionType::DEFAULT,
19902 };
19903 #[cfg(feature = "arbitrary")]
19904 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19905 use arbitrary::{Arbitrary, Unstructured};
19906 let mut buf = [0u8; 1024];
19907 rng.fill_bytes(&mut buf);
19908 let mut unstructured = Unstructured::new(&buf);
19909 Self::arbitrary(&mut unstructured).unwrap_or_default()
19910 }
19911}
19912impl Default for MISSION_REQUEST_INT_DATA {
19913 fn default() -> Self {
19914 Self::DEFAULT.clone()
19915 }
19916}
19917impl MessageData for MISSION_REQUEST_INT_DATA {
19918 type Message = MavMessage;
19919 const ID: u32 = 51u32;
19920 const NAME: &'static str = "MISSION_REQUEST_INT";
19921 const EXTRA_CRC: u8 = 196u8;
19922 const ENCODED_LEN: usize = 5usize;
19923 fn deser(
19924 _version: MavlinkVersion,
19925 __input: &[u8],
19926 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19927 let avail_len = __input.len();
19928 let mut payload_buf = [0; Self::ENCODED_LEN];
19929 let mut buf = if avail_len < Self::ENCODED_LEN {
19930 payload_buf[0..avail_len].copy_from_slice(__input);
19931 Bytes::new(&payload_buf)
19932 } else {
19933 Bytes::new(__input)
19934 };
19935 let mut __struct = Self::default();
19936 __struct.seq = buf.get_u16_le();
19937 __struct.target_system = buf.get_u8();
19938 __struct.target_component = buf.get_u8();
19939 let tmp = buf.get_u8();
19940 __struct.mission_type =
19941 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19942 enum_type: "MavMissionType",
19943 value: tmp as u32,
19944 })?;
19945 Ok(__struct)
19946 }
19947 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19948 let mut __tmp = BytesMut::new(bytes);
19949 #[allow(clippy::absurd_extreme_comparisons)]
19950 #[allow(unused_comparisons)]
19951 if __tmp.remaining() < Self::ENCODED_LEN {
19952 panic!(
19953 "buffer is too small (need {} bytes, but got {})",
19954 Self::ENCODED_LEN,
19955 __tmp.remaining(),
19956 )
19957 }
19958 __tmp.put_u16_le(self.seq);
19959 __tmp.put_u8(self.target_system);
19960 __tmp.put_u8(self.target_component);
19961 if matches!(version, MavlinkVersion::V2) {
19962 __tmp.put_u8(self.mission_type as u8);
19963 let len = __tmp.len();
19964 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19965 } else {
19966 __tmp.len()
19967 }
19968 }
19969}
19970#[doc = "Request the overall list of mission items from the system/component."]
19971#[doc = ""]
19972#[doc = "ID: 43"]
19973#[derive(Debug, Clone, PartialEq)]
19974#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19976pub struct MISSION_REQUEST_LIST_DATA {
19977 #[doc = "System ID"]
19978 pub target_system: u8,
19979 #[doc = "Component ID"]
19980 pub target_component: u8,
19981 #[doc = "Mission type."]
19982 #[cfg_attr(feature = "serde", serde(default))]
19983 pub mission_type: MavMissionType,
19984}
19985impl MISSION_REQUEST_LIST_DATA {
19986 pub const ENCODED_LEN: usize = 3usize;
19987 pub const DEFAULT: Self = Self {
19988 target_system: 0_u8,
19989 target_component: 0_u8,
19990 mission_type: MavMissionType::DEFAULT,
19991 };
19992 #[cfg(feature = "arbitrary")]
19993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19994 use arbitrary::{Arbitrary, Unstructured};
19995 let mut buf = [0u8; 1024];
19996 rng.fill_bytes(&mut buf);
19997 let mut unstructured = Unstructured::new(&buf);
19998 Self::arbitrary(&mut unstructured).unwrap_or_default()
19999 }
20000}
20001impl Default for MISSION_REQUEST_LIST_DATA {
20002 fn default() -> Self {
20003 Self::DEFAULT.clone()
20004 }
20005}
20006impl MessageData for MISSION_REQUEST_LIST_DATA {
20007 type Message = MavMessage;
20008 const ID: u32 = 43u32;
20009 const NAME: &'static str = "MISSION_REQUEST_LIST";
20010 const EXTRA_CRC: u8 = 132u8;
20011 const ENCODED_LEN: usize = 3usize;
20012 fn deser(
20013 _version: MavlinkVersion,
20014 __input: &[u8],
20015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20016 let avail_len = __input.len();
20017 let mut payload_buf = [0; Self::ENCODED_LEN];
20018 let mut buf = if avail_len < Self::ENCODED_LEN {
20019 payload_buf[0..avail_len].copy_from_slice(__input);
20020 Bytes::new(&payload_buf)
20021 } else {
20022 Bytes::new(__input)
20023 };
20024 let mut __struct = Self::default();
20025 __struct.target_system = buf.get_u8();
20026 __struct.target_component = buf.get_u8();
20027 let tmp = buf.get_u8();
20028 __struct.mission_type =
20029 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20030 enum_type: "MavMissionType",
20031 value: tmp as u32,
20032 })?;
20033 Ok(__struct)
20034 }
20035 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20036 let mut __tmp = BytesMut::new(bytes);
20037 #[allow(clippy::absurd_extreme_comparisons)]
20038 #[allow(unused_comparisons)]
20039 if __tmp.remaining() < Self::ENCODED_LEN {
20040 panic!(
20041 "buffer is too small (need {} bytes, but got {})",
20042 Self::ENCODED_LEN,
20043 __tmp.remaining(),
20044 )
20045 }
20046 __tmp.put_u8(self.target_system);
20047 __tmp.put_u8(self.target_component);
20048 if matches!(version, MavlinkVersion::V2) {
20049 __tmp.put_u8(self.mission_type as u8);
20050 let len = __tmp.len();
20051 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20052 } else {
20053 __tmp.len()
20054 }
20055 }
20056}
20057#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20058#[doc = ""]
20059#[doc = "ID: 37"]
20060#[derive(Debug, Clone, PartialEq)]
20061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20063pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20064 #[doc = "Start index"]
20065 pub start_index: i16,
20066 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20067 pub end_index: i16,
20068 #[doc = "System ID"]
20069 pub target_system: u8,
20070 #[doc = "Component ID"]
20071 pub target_component: u8,
20072 #[doc = "Mission type."]
20073 #[cfg_attr(feature = "serde", serde(default))]
20074 pub mission_type: MavMissionType,
20075}
20076impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20077 pub const ENCODED_LEN: usize = 7usize;
20078 pub const DEFAULT: Self = Self {
20079 start_index: 0_i16,
20080 end_index: 0_i16,
20081 target_system: 0_u8,
20082 target_component: 0_u8,
20083 mission_type: MavMissionType::DEFAULT,
20084 };
20085 #[cfg(feature = "arbitrary")]
20086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20087 use arbitrary::{Arbitrary, Unstructured};
20088 let mut buf = [0u8; 1024];
20089 rng.fill_bytes(&mut buf);
20090 let mut unstructured = Unstructured::new(&buf);
20091 Self::arbitrary(&mut unstructured).unwrap_or_default()
20092 }
20093}
20094impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20095 fn default() -> Self {
20096 Self::DEFAULT.clone()
20097 }
20098}
20099impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20100 type Message = MavMessage;
20101 const ID: u32 = 37u32;
20102 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20103 const EXTRA_CRC: u8 = 212u8;
20104 const ENCODED_LEN: usize = 7usize;
20105 fn deser(
20106 _version: MavlinkVersion,
20107 __input: &[u8],
20108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20109 let avail_len = __input.len();
20110 let mut payload_buf = [0; Self::ENCODED_LEN];
20111 let mut buf = if avail_len < Self::ENCODED_LEN {
20112 payload_buf[0..avail_len].copy_from_slice(__input);
20113 Bytes::new(&payload_buf)
20114 } else {
20115 Bytes::new(__input)
20116 };
20117 let mut __struct = Self::default();
20118 __struct.start_index = buf.get_i16_le();
20119 __struct.end_index = buf.get_i16_le();
20120 __struct.target_system = buf.get_u8();
20121 __struct.target_component = buf.get_u8();
20122 let tmp = buf.get_u8();
20123 __struct.mission_type =
20124 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20125 enum_type: "MavMissionType",
20126 value: tmp as u32,
20127 })?;
20128 Ok(__struct)
20129 }
20130 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20131 let mut __tmp = BytesMut::new(bytes);
20132 #[allow(clippy::absurd_extreme_comparisons)]
20133 #[allow(unused_comparisons)]
20134 if __tmp.remaining() < Self::ENCODED_LEN {
20135 panic!(
20136 "buffer is too small (need {} bytes, but got {})",
20137 Self::ENCODED_LEN,
20138 __tmp.remaining(),
20139 )
20140 }
20141 __tmp.put_i16_le(self.start_index);
20142 __tmp.put_i16_le(self.end_index);
20143 __tmp.put_u8(self.target_system);
20144 __tmp.put_u8(self.target_component);
20145 if matches!(version, MavlinkVersion::V2) {
20146 __tmp.put_u8(self.mission_type as u8);
20147 let len = __tmp.len();
20148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20149 } else {
20150 __tmp.len()
20151 }
20152 }
20153}
20154#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20155#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20156#[doc = ""]
20157#[doc = "ID: 41"]
20158#[derive(Debug, Clone, PartialEq)]
20159#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20160#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20161pub struct MISSION_SET_CURRENT_DATA {
20162 #[doc = "Sequence"]
20163 pub seq: u16,
20164 #[doc = "System ID"]
20165 pub target_system: u8,
20166 #[doc = "Component ID"]
20167 pub target_component: u8,
20168}
20169impl MISSION_SET_CURRENT_DATA {
20170 pub const ENCODED_LEN: usize = 4usize;
20171 pub const DEFAULT: Self = Self {
20172 seq: 0_u16,
20173 target_system: 0_u8,
20174 target_component: 0_u8,
20175 };
20176 #[cfg(feature = "arbitrary")]
20177 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20178 use arbitrary::{Arbitrary, Unstructured};
20179 let mut buf = [0u8; 1024];
20180 rng.fill_bytes(&mut buf);
20181 let mut unstructured = Unstructured::new(&buf);
20182 Self::arbitrary(&mut unstructured).unwrap_or_default()
20183 }
20184}
20185impl Default for MISSION_SET_CURRENT_DATA {
20186 fn default() -> Self {
20187 Self::DEFAULT.clone()
20188 }
20189}
20190impl MessageData for MISSION_SET_CURRENT_DATA {
20191 type Message = MavMessage;
20192 const ID: u32 = 41u32;
20193 const NAME: &'static str = "MISSION_SET_CURRENT";
20194 const EXTRA_CRC: u8 = 28u8;
20195 const ENCODED_LEN: usize = 4usize;
20196 fn deser(
20197 _version: MavlinkVersion,
20198 __input: &[u8],
20199 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20200 let avail_len = __input.len();
20201 let mut payload_buf = [0; Self::ENCODED_LEN];
20202 let mut buf = if avail_len < Self::ENCODED_LEN {
20203 payload_buf[0..avail_len].copy_from_slice(__input);
20204 Bytes::new(&payload_buf)
20205 } else {
20206 Bytes::new(__input)
20207 };
20208 let mut __struct = Self::default();
20209 __struct.seq = buf.get_u16_le();
20210 __struct.target_system = buf.get_u8();
20211 __struct.target_component = buf.get_u8();
20212 Ok(__struct)
20213 }
20214 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20215 let mut __tmp = BytesMut::new(bytes);
20216 #[allow(clippy::absurd_extreme_comparisons)]
20217 #[allow(unused_comparisons)]
20218 if __tmp.remaining() < Self::ENCODED_LEN {
20219 panic!(
20220 "buffer is too small (need {} bytes, but got {})",
20221 Self::ENCODED_LEN,
20222 __tmp.remaining(),
20223 )
20224 }
20225 __tmp.put_u16_le(self.seq);
20226 __tmp.put_u8(self.target_system);
20227 __tmp.put_u8(self.target_component);
20228 if matches!(version, MavlinkVersion::V2) {
20229 let len = __tmp.len();
20230 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20231 } else {
20232 __tmp.len()
20233 }
20234 }
20235}
20236#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20237#[doc = ""]
20238#[doc = "ID: 38"]
20239#[derive(Debug, Clone, PartialEq)]
20240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20242pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20243 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20244 pub start_index: i16,
20245 #[doc = "End index, equal or greater than start index."]
20246 pub end_index: i16,
20247 #[doc = "System ID"]
20248 pub target_system: u8,
20249 #[doc = "Component ID"]
20250 pub target_component: u8,
20251 #[doc = "Mission type."]
20252 #[cfg_attr(feature = "serde", serde(default))]
20253 pub mission_type: MavMissionType,
20254}
20255impl MISSION_WRITE_PARTIAL_LIST_DATA {
20256 pub const ENCODED_LEN: usize = 7usize;
20257 pub const DEFAULT: Self = Self {
20258 start_index: 0_i16,
20259 end_index: 0_i16,
20260 target_system: 0_u8,
20261 target_component: 0_u8,
20262 mission_type: MavMissionType::DEFAULT,
20263 };
20264 #[cfg(feature = "arbitrary")]
20265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20266 use arbitrary::{Arbitrary, Unstructured};
20267 let mut buf = [0u8; 1024];
20268 rng.fill_bytes(&mut buf);
20269 let mut unstructured = Unstructured::new(&buf);
20270 Self::arbitrary(&mut unstructured).unwrap_or_default()
20271 }
20272}
20273impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20274 fn default() -> Self {
20275 Self::DEFAULT.clone()
20276 }
20277}
20278impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20279 type Message = MavMessage;
20280 const ID: u32 = 38u32;
20281 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20282 const EXTRA_CRC: u8 = 9u8;
20283 const ENCODED_LEN: usize = 7usize;
20284 fn deser(
20285 _version: MavlinkVersion,
20286 __input: &[u8],
20287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20288 let avail_len = __input.len();
20289 let mut payload_buf = [0; Self::ENCODED_LEN];
20290 let mut buf = if avail_len < Self::ENCODED_LEN {
20291 payload_buf[0..avail_len].copy_from_slice(__input);
20292 Bytes::new(&payload_buf)
20293 } else {
20294 Bytes::new(__input)
20295 };
20296 let mut __struct = Self::default();
20297 __struct.start_index = buf.get_i16_le();
20298 __struct.end_index = buf.get_i16_le();
20299 __struct.target_system = buf.get_u8();
20300 __struct.target_component = buf.get_u8();
20301 let tmp = buf.get_u8();
20302 __struct.mission_type =
20303 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20304 enum_type: "MavMissionType",
20305 value: tmp as u32,
20306 })?;
20307 Ok(__struct)
20308 }
20309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20310 let mut __tmp = BytesMut::new(bytes);
20311 #[allow(clippy::absurd_extreme_comparisons)]
20312 #[allow(unused_comparisons)]
20313 if __tmp.remaining() < Self::ENCODED_LEN {
20314 panic!(
20315 "buffer is too small (need {} bytes, but got {})",
20316 Self::ENCODED_LEN,
20317 __tmp.remaining(),
20318 )
20319 }
20320 __tmp.put_i16_le(self.start_index);
20321 __tmp.put_i16_le(self.end_index);
20322 __tmp.put_u8(self.target_system);
20323 __tmp.put_u8(self.target_component);
20324 if matches!(version, MavlinkVersion::V2) {
20325 __tmp.put_u8(self.mission_type as u8);
20326 let len = __tmp.len();
20327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20328 } else {
20329 __tmp.len()
20330 }
20331 }
20332}
20333#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20334#[doc = "Orientation of a mount."]
20335#[doc = ""]
20336#[doc = "ID: 265"]
20337#[derive(Debug, Clone, PartialEq)]
20338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20340pub struct MOUNT_ORIENTATION_DATA {
20341 #[doc = "Timestamp (time since system boot)."]
20342 pub time_boot_ms: u32,
20343 #[doc = "Roll in global frame (set to NaN for invalid)."]
20344 pub roll: f32,
20345 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20346 pub pitch: f32,
20347 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20348 pub yaw: f32,
20349 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20350 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20351 pub yaw_absolute: f32,
20352}
20353impl MOUNT_ORIENTATION_DATA {
20354 pub const ENCODED_LEN: usize = 20usize;
20355 pub const DEFAULT: Self = Self {
20356 time_boot_ms: 0_u32,
20357 roll: 0.0_f32,
20358 pitch: 0.0_f32,
20359 yaw: 0.0_f32,
20360 yaw_absolute: 0.0_f32,
20361 };
20362 #[cfg(feature = "arbitrary")]
20363 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20364 use arbitrary::{Arbitrary, Unstructured};
20365 let mut buf = [0u8; 1024];
20366 rng.fill_bytes(&mut buf);
20367 let mut unstructured = Unstructured::new(&buf);
20368 Self::arbitrary(&mut unstructured).unwrap_or_default()
20369 }
20370}
20371impl Default for MOUNT_ORIENTATION_DATA {
20372 fn default() -> Self {
20373 Self::DEFAULT.clone()
20374 }
20375}
20376impl MessageData for MOUNT_ORIENTATION_DATA {
20377 type Message = MavMessage;
20378 const ID: u32 = 265u32;
20379 const NAME: &'static str = "MOUNT_ORIENTATION";
20380 const EXTRA_CRC: u8 = 26u8;
20381 const ENCODED_LEN: usize = 20usize;
20382 fn deser(
20383 _version: MavlinkVersion,
20384 __input: &[u8],
20385 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20386 let avail_len = __input.len();
20387 let mut payload_buf = [0; Self::ENCODED_LEN];
20388 let mut buf = if avail_len < Self::ENCODED_LEN {
20389 payload_buf[0..avail_len].copy_from_slice(__input);
20390 Bytes::new(&payload_buf)
20391 } else {
20392 Bytes::new(__input)
20393 };
20394 let mut __struct = Self::default();
20395 __struct.time_boot_ms = buf.get_u32_le();
20396 __struct.roll = buf.get_f32_le();
20397 __struct.pitch = buf.get_f32_le();
20398 __struct.yaw = buf.get_f32_le();
20399 __struct.yaw_absolute = buf.get_f32_le();
20400 Ok(__struct)
20401 }
20402 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20403 let mut __tmp = BytesMut::new(bytes);
20404 #[allow(clippy::absurd_extreme_comparisons)]
20405 #[allow(unused_comparisons)]
20406 if __tmp.remaining() < Self::ENCODED_LEN {
20407 panic!(
20408 "buffer is too small (need {} bytes, but got {})",
20409 Self::ENCODED_LEN,
20410 __tmp.remaining(),
20411 )
20412 }
20413 __tmp.put_u32_le(self.time_boot_ms);
20414 __tmp.put_f32_le(self.roll);
20415 __tmp.put_f32_le(self.pitch);
20416 __tmp.put_f32_le(self.yaw);
20417 if matches!(version, MavlinkVersion::V2) {
20418 __tmp.put_f32_le(self.yaw_absolute);
20419 let len = __tmp.len();
20420 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20421 } else {
20422 __tmp.len()
20423 }
20424 }
20425}
20426#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20427#[doc = ""]
20428#[doc = "ID: 251"]
20429#[derive(Debug, Clone, PartialEq)]
20430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20431#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20432pub struct NAMED_VALUE_FLOAT_DATA {
20433 #[doc = "Timestamp (time since system boot)."]
20434 pub time_boot_ms: u32,
20435 #[doc = "Floating point value"]
20436 pub value: f32,
20437 #[doc = "Name of the debug variable"]
20438 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20439 pub name: [u8; 10],
20440}
20441impl NAMED_VALUE_FLOAT_DATA {
20442 pub const ENCODED_LEN: usize = 18usize;
20443 pub const DEFAULT: Self = Self {
20444 time_boot_ms: 0_u32,
20445 value: 0.0_f32,
20446 name: [0_u8; 10usize],
20447 };
20448 #[cfg(feature = "arbitrary")]
20449 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20450 use arbitrary::{Arbitrary, Unstructured};
20451 let mut buf = [0u8; 1024];
20452 rng.fill_bytes(&mut buf);
20453 let mut unstructured = Unstructured::new(&buf);
20454 Self::arbitrary(&mut unstructured).unwrap_or_default()
20455 }
20456}
20457impl Default for NAMED_VALUE_FLOAT_DATA {
20458 fn default() -> Self {
20459 Self::DEFAULT.clone()
20460 }
20461}
20462impl MessageData for NAMED_VALUE_FLOAT_DATA {
20463 type Message = MavMessage;
20464 const ID: u32 = 251u32;
20465 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20466 const EXTRA_CRC: u8 = 170u8;
20467 const ENCODED_LEN: usize = 18usize;
20468 fn deser(
20469 _version: MavlinkVersion,
20470 __input: &[u8],
20471 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20472 let avail_len = __input.len();
20473 let mut payload_buf = [0; Self::ENCODED_LEN];
20474 let mut buf = if avail_len < Self::ENCODED_LEN {
20475 payload_buf[0..avail_len].copy_from_slice(__input);
20476 Bytes::new(&payload_buf)
20477 } else {
20478 Bytes::new(__input)
20479 };
20480 let mut __struct = Self::default();
20481 __struct.time_boot_ms = buf.get_u32_le();
20482 __struct.value = buf.get_f32_le();
20483 for v in &mut __struct.name {
20484 let val = buf.get_u8();
20485 *v = val;
20486 }
20487 Ok(__struct)
20488 }
20489 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20490 let mut __tmp = BytesMut::new(bytes);
20491 #[allow(clippy::absurd_extreme_comparisons)]
20492 #[allow(unused_comparisons)]
20493 if __tmp.remaining() < Self::ENCODED_LEN {
20494 panic!(
20495 "buffer is too small (need {} bytes, but got {})",
20496 Self::ENCODED_LEN,
20497 __tmp.remaining(),
20498 )
20499 }
20500 __tmp.put_u32_le(self.time_boot_ms);
20501 __tmp.put_f32_le(self.value);
20502 for val in &self.name {
20503 __tmp.put_u8(*val);
20504 }
20505 if matches!(version, MavlinkVersion::V2) {
20506 let len = __tmp.len();
20507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20508 } else {
20509 __tmp.len()
20510 }
20511 }
20512}
20513#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20514#[doc = ""]
20515#[doc = "ID: 252"]
20516#[derive(Debug, Clone, PartialEq)]
20517#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20519pub struct NAMED_VALUE_INT_DATA {
20520 #[doc = "Timestamp (time since system boot)."]
20521 pub time_boot_ms: u32,
20522 #[doc = "Signed integer value"]
20523 pub value: i32,
20524 #[doc = "Name of the debug variable"]
20525 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20526 pub name: [u8; 10],
20527}
20528impl NAMED_VALUE_INT_DATA {
20529 pub const ENCODED_LEN: usize = 18usize;
20530 pub const DEFAULT: Self = Self {
20531 time_boot_ms: 0_u32,
20532 value: 0_i32,
20533 name: [0_u8; 10usize],
20534 };
20535 #[cfg(feature = "arbitrary")]
20536 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20537 use arbitrary::{Arbitrary, Unstructured};
20538 let mut buf = [0u8; 1024];
20539 rng.fill_bytes(&mut buf);
20540 let mut unstructured = Unstructured::new(&buf);
20541 Self::arbitrary(&mut unstructured).unwrap_or_default()
20542 }
20543}
20544impl Default for NAMED_VALUE_INT_DATA {
20545 fn default() -> Self {
20546 Self::DEFAULT.clone()
20547 }
20548}
20549impl MessageData for NAMED_VALUE_INT_DATA {
20550 type Message = MavMessage;
20551 const ID: u32 = 252u32;
20552 const NAME: &'static str = "NAMED_VALUE_INT";
20553 const EXTRA_CRC: u8 = 44u8;
20554 const ENCODED_LEN: usize = 18usize;
20555 fn deser(
20556 _version: MavlinkVersion,
20557 __input: &[u8],
20558 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20559 let avail_len = __input.len();
20560 let mut payload_buf = [0; Self::ENCODED_LEN];
20561 let mut buf = if avail_len < Self::ENCODED_LEN {
20562 payload_buf[0..avail_len].copy_from_slice(__input);
20563 Bytes::new(&payload_buf)
20564 } else {
20565 Bytes::new(__input)
20566 };
20567 let mut __struct = Self::default();
20568 __struct.time_boot_ms = buf.get_u32_le();
20569 __struct.value = buf.get_i32_le();
20570 for v in &mut __struct.name {
20571 let val = buf.get_u8();
20572 *v = val;
20573 }
20574 Ok(__struct)
20575 }
20576 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20577 let mut __tmp = BytesMut::new(bytes);
20578 #[allow(clippy::absurd_extreme_comparisons)]
20579 #[allow(unused_comparisons)]
20580 if __tmp.remaining() < Self::ENCODED_LEN {
20581 panic!(
20582 "buffer is too small (need {} bytes, but got {})",
20583 Self::ENCODED_LEN,
20584 __tmp.remaining(),
20585 )
20586 }
20587 __tmp.put_u32_le(self.time_boot_ms);
20588 __tmp.put_i32_le(self.value);
20589 for val in &self.name {
20590 __tmp.put_u8(*val);
20591 }
20592 if matches!(version, MavlinkVersion::V2) {
20593 let len = __tmp.len();
20594 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20595 } else {
20596 __tmp.len()
20597 }
20598 }
20599}
20600#[doc = "The state of the navigation and position controller."]
20601#[doc = ""]
20602#[doc = "ID: 62"]
20603#[derive(Debug, Clone, PartialEq)]
20604#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20606pub struct NAV_CONTROLLER_OUTPUT_DATA {
20607 #[doc = "Current desired roll"]
20608 pub nav_roll: f32,
20609 #[doc = "Current desired pitch"]
20610 pub nav_pitch: f32,
20611 #[doc = "Current altitude error"]
20612 pub alt_error: f32,
20613 #[doc = "Current airspeed error"]
20614 pub aspd_error: f32,
20615 #[doc = "Current crosstrack error on x-y plane"]
20616 pub xtrack_error: f32,
20617 #[doc = "Current desired heading"]
20618 pub nav_bearing: i16,
20619 #[doc = "Bearing to current waypoint/target"]
20620 pub target_bearing: i16,
20621 #[doc = "Distance to active waypoint"]
20622 pub wp_dist: u16,
20623}
20624impl NAV_CONTROLLER_OUTPUT_DATA {
20625 pub const ENCODED_LEN: usize = 26usize;
20626 pub const DEFAULT: Self = Self {
20627 nav_roll: 0.0_f32,
20628 nav_pitch: 0.0_f32,
20629 alt_error: 0.0_f32,
20630 aspd_error: 0.0_f32,
20631 xtrack_error: 0.0_f32,
20632 nav_bearing: 0_i16,
20633 target_bearing: 0_i16,
20634 wp_dist: 0_u16,
20635 };
20636 #[cfg(feature = "arbitrary")]
20637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20638 use arbitrary::{Arbitrary, Unstructured};
20639 let mut buf = [0u8; 1024];
20640 rng.fill_bytes(&mut buf);
20641 let mut unstructured = Unstructured::new(&buf);
20642 Self::arbitrary(&mut unstructured).unwrap_or_default()
20643 }
20644}
20645impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20646 fn default() -> Self {
20647 Self::DEFAULT.clone()
20648 }
20649}
20650impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20651 type Message = MavMessage;
20652 const ID: u32 = 62u32;
20653 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20654 const EXTRA_CRC: u8 = 183u8;
20655 const ENCODED_LEN: usize = 26usize;
20656 fn deser(
20657 _version: MavlinkVersion,
20658 __input: &[u8],
20659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20660 let avail_len = __input.len();
20661 let mut payload_buf = [0; Self::ENCODED_LEN];
20662 let mut buf = if avail_len < Self::ENCODED_LEN {
20663 payload_buf[0..avail_len].copy_from_slice(__input);
20664 Bytes::new(&payload_buf)
20665 } else {
20666 Bytes::new(__input)
20667 };
20668 let mut __struct = Self::default();
20669 __struct.nav_roll = buf.get_f32_le();
20670 __struct.nav_pitch = buf.get_f32_le();
20671 __struct.alt_error = buf.get_f32_le();
20672 __struct.aspd_error = buf.get_f32_le();
20673 __struct.xtrack_error = buf.get_f32_le();
20674 __struct.nav_bearing = buf.get_i16_le();
20675 __struct.target_bearing = buf.get_i16_le();
20676 __struct.wp_dist = buf.get_u16_le();
20677 Ok(__struct)
20678 }
20679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20680 let mut __tmp = BytesMut::new(bytes);
20681 #[allow(clippy::absurd_extreme_comparisons)]
20682 #[allow(unused_comparisons)]
20683 if __tmp.remaining() < Self::ENCODED_LEN {
20684 panic!(
20685 "buffer is too small (need {} bytes, but got {})",
20686 Self::ENCODED_LEN,
20687 __tmp.remaining(),
20688 )
20689 }
20690 __tmp.put_f32_le(self.nav_roll);
20691 __tmp.put_f32_le(self.nav_pitch);
20692 __tmp.put_f32_le(self.alt_error);
20693 __tmp.put_f32_le(self.aspd_error);
20694 __tmp.put_f32_le(self.xtrack_error);
20695 __tmp.put_i16_le(self.nav_bearing);
20696 __tmp.put_i16_le(self.target_bearing);
20697 __tmp.put_u16_le(self.wp_dist);
20698 if matches!(version, MavlinkVersion::V2) {
20699 let len = __tmp.len();
20700 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20701 } else {
20702 __tmp.len()
20703 }
20704 }
20705}
20706#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20707#[doc = ""]
20708#[doc = "ID: 330"]
20709#[derive(Debug, Clone, PartialEq)]
20710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20712pub struct OBSTACLE_DISTANCE_DATA {
20713 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20714 pub time_usec: u64,
20715 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20716 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20717 pub distances: [u16; 72],
20718 #[doc = "Minimum distance the sensor can measure."]
20719 pub min_distance: u16,
20720 #[doc = "Maximum distance the sensor can measure."]
20721 pub max_distance: u16,
20722 #[doc = "Class id of the distance sensor type."]
20723 pub sensor_type: MavDistanceSensor,
20724 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20725 pub increment: u8,
20726 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20727 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20728 pub increment_f: f32,
20729 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20730 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20731 pub angle_offset: f32,
20732 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20733 #[cfg_attr(feature = "serde", serde(default))]
20734 pub frame: MavFrame,
20735}
20736impl OBSTACLE_DISTANCE_DATA {
20737 pub const ENCODED_LEN: usize = 167usize;
20738 pub const DEFAULT: Self = Self {
20739 time_usec: 0_u64,
20740 distances: [0_u16; 72usize],
20741 min_distance: 0_u16,
20742 max_distance: 0_u16,
20743 sensor_type: MavDistanceSensor::DEFAULT,
20744 increment: 0_u8,
20745 increment_f: 0.0_f32,
20746 angle_offset: 0.0_f32,
20747 frame: MavFrame::DEFAULT,
20748 };
20749 #[cfg(feature = "arbitrary")]
20750 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20751 use arbitrary::{Arbitrary, Unstructured};
20752 let mut buf = [0u8; 1024];
20753 rng.fill_bytes(&mut buf);
20754 let mut unstructured = Unstructured::new(&buf);
20755 Self::arbitrary(&mut unstructured).unwrap_or_default()
20756 }
20757}
20758impl Default for OBSTACLE_DISTANCE_DATA {
20759 fn default() -> Self {
20760 Self::DEFAULT.clone()
20761 }
20762}
20763impl MessageData for OBSTACLE_DISTANCE_DATA {
20764 type Message = MavMessage;
20765 const ID: u32 = 330u32;
20766 const NAME: &'static str = "OBSTACLE_DISTANCE";
20767 const EXTRA_CRC: u8 = 23u8;
20768 const ENCODED_LEN: usize = 167usize;
20769 fn deser(
20770 _version: MavlinkVersion,
20771 __input: &[u8],
20772 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20773 let avail_len = __input.len();
20774 let mut payload_buf = [0; Self::ENCODED_LEN];
20775 let mut buf = if avail_len < Self::ENCODED_LEN {
20776 payload_buf[0..avail_len].copy_from_slice(__input);
20777 Bytes::new(&payload_buf)
20778 } else {
20779 Bytes::new(__input)
20780 };
20781 let mut __struct = Self::default();
20782 __struct.time_usec = buf.get_u64_le();
20783 for v in &mut __struct.distances {
20784 let val = buf.get_u16_le();
20785 *v = val;
20786 }
20787 __struct.min_distance = buf.get_u16_le();
20788 __struct.max_distance = buf.get_u16_le();
20789 let tmp = buf.get_u8();
20790 __struct.sensor_type =
20791 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20792 enum_type: "MavDistanceSensor",
20793 value: tmp as u32,
20794 })?;
20795 __struct.increment = buf.get_u8();
20796 __struct.increment_f = buf.get_f32_le();
20797 __struct.angle_offset = buf.get_f32_le();
20798 let tmp = buf.get_u8();
20799 __struct.frame =
20800 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20801 enum_type: "MavFrame",
20802 value: tmp as u32,
20803 })?;
20804 Ok(__struct)
20805 }
20806 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20807 let mut __tmp = BytesMut::new(bytes);
20808 #[allow(clippy::absurd_extreme_comparisons)]
20809 #[allow(unused_comparisons)]
20810 if __tmp.remaining() < Self::ENCODED_LEN {
20811 panic!(
20812 "buffer is too small (need {} bytes, but got {})",
20813 Self::ENCODED_LEN,
20814 __tmp.remaining(),
20815 )
20816 }
20817 __tmp.put_u64_le(self.time_usec);
20818 for val in &self.distances {
20819 __tmp.put_u16_le(*val);
20820 }
20821 __tmp.put_u16_le(self.min_distance);
20822 __tmp.put_u16_le(self.max_distance);
20823 __tmp.put_u8(self.sensor_type as u8);
20824 __tmp.put_u8(self.increment);
20825 if matches!(version, MavlinkVersion::V2) {
20826 __tmp.put_f32_le(self.increment_f);
20827 __tmp.put_f32_le(self.angle_offset);
20828 __tmp.put_u8(self.frame as u8);
20829 let len = __tmp.len();
20830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20831 } else {
20832 __tmp.len()
20833 }
20834 }
20835}
20836#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20837#[doc = ""]
20838#[doc = "ID: 331"]
20839#[derive(Debug, Clone, PartialEq)]
20840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20842pub struct ODOMETRY_DATA {
20843 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20844 pub time_usec: u64,
20845 #[doc = "X Position"]
20846 pub x: f32,
20847 #[doc = "Y Position"]
20848 pub y: f32,
20849 #[doc = "Z Position"]
20850 pub z: f32,
20851 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
20852 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20853 pub q: [f32; 4],
20854 #[doc = "X linear speed"]
20855 pub vx: f32,
20856 #[doc = "Y linear speed"]
20857 pub vy: f32,
20858 #[doc = "Z linear speed"]
20859 pub vz: f32,
20860 #[doc = "Roll angular speed"]
20861 pub rollspeed: f32,
20862 #[doc = "Pitch angular speed"]
20863 pub pitchspeed: f32,
20864 #[doc = "Yaw angular speed"]
20865 pub yawspeed: f32,
20866 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20867 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20868 pub pose_covariance: [f32; 21],
20869 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20870 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20871 pub velocity_covariance: [f32; 21],
20872 #[doc = "Coordinate frame of reference for the pose data."]
20873 pub frame_id: MavFrame,
20874 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
20875 pub child_frame_id: MavFrame,
20876 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
20877 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20878 pub reset_counter: u8,
20879 #[doc = "Type of estimator that is providing the odometry."]
20880 #[cfg_attr(feature = "serde", serde(default))]
20881 pub estimator_type: MavEstimatorType,
20882 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
20883 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20884 pub quality: i8,
20885}
20886impl ODOMETRY_DATA {
20887 pub const ENCODED_LEN: usize = 233usize;
20888 pub const DEFAULT: Self = Self {
20889 time_usec: 0_u64,
20890 x: 0.0_f32,
20891 y: 0.0_f32,
20892 z: 0.0_f32,
20893 q: [0.0_f32; 4usize],
20894 vx: 0.0_f32,
20895 vy: 0.0_f32,
20896 vz: 0.0_f32,
20897 rollspeed: 0.0_f32,
20898 pitchspeed: 0.0_f32,
20899 yawspeed: 0.0_f32,
20900 pose_covariance: [0.0_f32; 21usize],
20901 velocity_covariance: [0.0_f32; 21usize],
20902 frame_id: MavFrame::DEFAULT,
20903 child_frame_id: MavFrame::DEFAULT,
20904 reset_counter: 0_u8,
20905 estimator_type: MavEstimatorType::DEFAULT,
20906 quality: 0_i8,
20907 };
20908 #[cfg(feature = "arbitrary")]
20909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20910 use arbitrary::{Arbitrary, Unstructured};
20911 let mut buf = [0u8; 1024];
20912 rng.fill_bytes(&mut buf);
20913 let mut unstructured = Unstructured::new(&buf);
20914 Self::arbitrary(&mut unstructured).unwrap_or_default()
20915 }
20916}
20917impl Default for ODOMETRY_DATA {
20918 fn default() -> Self {
20919 Self::DEFAULT.clone()
20920 }
20921}
20922impl MessageData for ODOMETRY_DATA {
20923 type Message = MavMessage;
20924 const ID: u32 = 331u32;
20925 const NAME: &'static str = "ODOMETRY";
20926 const EXTRA_CRC: u8 = 91u8;
20927 const ENCODED_LEN: usize = 233usize;
20928 fn deser(
20929 _version: MavlinkVersion,
20930 __input: &[u8],
20931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20932 let avail_len = __input.len();
20933 let mut payload_buf = [0; Self::ENCODED_LEN];
20934 let mut buf = if avail_len < Self::ENCODED_LEN {
20935 payload_buf[0..avail_len].copy_from_slice(__input);
20936 Bytes::new(&payload_buf)
20937 } else {
20938 Bytes::new(__input)
20939 };
20940 let mut __struct = Self::default();
20941 __struct.time_usec = buf.get_u64_le();
20942 __struct.x = buf.get_f32_le();
20943 __struct.y = buf.get_f32_le();
20944 __struct.z = buf.get_f32_le();
20945 for v in &mut __struct.q {
20946 let val = buf.get_f32_le();
20947 *v = val;
20948 }
20949 __struct.vx = buf.get_f32_le();
20950 __struct.vy = buf.get_f32_le();
20951 __struct.vz = buf.get_f32_le();
20952 __struct.rollspeed = buf.get_f32_le();
20953 __struct.pitchspeed = buf.get_f32_le();
20954 __struct.yawspeed = buf.get_f32_le();
20955 for v in &mut __struct.pose_covariance {
20956 let val = buf.get_f32_le();
20957 *v = val;
20958 }
20959 for v in &mut __struct.velocity_covariance {
20960 let val = buf.get_f32_le();
20961 *v = val;
20962 }
20963 let tmp = buf.get_u8();
20964 __struct.frame_id =
20965 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20966 enum_type: "MavFrame",
20967 value: tmp as u32,
20968 })?;
20969 let tmp = buf.get_u8();
20970 __struct.child_frame_id =
20971 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20972 enum_type: "MavFrame",
20973 value: tmp as u32,
20974 })?;
20975 __struct.reset_counter = buf.get_u8();
20976 let tmp = buf.get_u8();
20977 __struct.estimator_type =
20978 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20979 enum_type: "MavEstimatorType",
20980 value: tmp as u32,
20981 })?;
20982 __struct.quality = buf.get_i8();
20983 Ok(__struct)
20984 }
20985 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20986 let mut __tmp = BytesMut::new(bytes);
20987 #[allow(clippy::absurd_extreme_comparisons)]
20988 #[allow(unused_comparisons)]
20989 if __tmp.remaining() < Self::ENCODED_LEN {
20990 panic!(
20991 "buffer is too small (need {} bytes, but got {})",
20992 Self::ENCODED_LEN,
20993 __tmp.remaining(),
20994 )
20995 }
20996 __tmp.put_u64_le(self.time_usec);
20997 __tmp.put_f32_le(self.x);
20998 __tmp.put_f32_le(self.y);
20999 __tmp.put_f32_le(self.z);
21000 for val in &self.q {
21001 __tmp.put_f32_le(*val);
21002 }
21003 __tmp.put_f32_le(self.vx);
21004 __tmp.put_f32_le(self.vy);
21005 __tmp.put_f32_le(self.vz);
21006 __tmp.put_f32_le(self.rollspeed);
21007 __tmp.put_f32_le(self.pitchspeed);
21008 __tmp.put_f32_le(self.yawspeed);
21009 for val in &self.pose_covariance {
21010 __tmp.put_f32_le(*val);
21011 }
21012 for val in &self.velocity_covariance {
21013 __tmp.put_f32_le(*val);
21014 }
21015 __tmp.put_u8(self.frame_id as u8);
21016 __tmp.put_u8(self.child_frame_id as u8);
21017 if matches!(version, MavlinkVersion::V2) {
21018 __tmp.put_u8(self.reset_counter);
21019 __tmp.put_u8(self.estimator_type as u8);
21020 __tmp.put_i8(self.quality);
21021 let len = __tmp.len();
21022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21023 } else {
21024 __tmp.len()
21025 }
21026 }
21027}
21028#[doc = "Hardware status sent by an onboard computer."]
21029#[doc = ""]
21030#[doc = "ID: 390"]
21031#[derive(Debug, Clone, PartialEq)]
21032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21034pub struct ONBOARD_COMPUTER_STATUS_DATA {
21035 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21036 pub time_usec: u64,
21037 #[doc = "Time since system boot."]
21038 pub uptime: u32,
21039 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21040 pub ram_usage: u32,
21041 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21042 pub ram_total: u32,
21043 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21045 pub storage_type: [u32; 4],
21046 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21048 pub storage_usage: [u32; 4],
21049 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21051 pub storage_total: [u32; 4],
21052 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21054 pub link_type: [u32; 6],
21055 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21056 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21057 pub link_tx_rate: [u32; 6],
21058 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21059 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21060 pub link_rx_rate: [u32; 6],
21061 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21062 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21063 pub link_tx_max: [u32; 6],
21064 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21065 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21066 pub link_rx_max: [u32; 6],
21067 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21068 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21069 pub fan_speed: [i16; 4],
21070 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21071 pub mavtype: u8,
21072 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21073 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21074 pub cpu_cores: [u8; 8],
21075 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21076 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21077 pub cpu_combined: [u8; 10],
21078 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21079 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21080 pub gpu_cores: [u8; 4],
21081 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21082 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21083 pub gpu_combined: [u8; 10],
21084 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21085 pub temperature_board: i8,
21086 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21087 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21088 pub temperature_core: [i8; 8],
21089}
21090impl ONBOARD_COMPUTER_STATUS_DATA {
21091 pub const ENCODED_LEN: usize = 238usize;
21092 pub const DEFAULT: Self = Self {
21093 time_usec: 0_u64,
21094 uptime: 0_u32,
21095 ram_usage: 0_u32,
21096 ram_total: 0_u32,
21097 storage_type: [0_u32; 4usize],
21098 storage_usage: [0_u32; 4usize],
21099 storage_total: [0_u32; 4usize],
21100 link_type: [0_u32; 6usize],
21101 link_tx_rate: [0_u32; 6usize],
21102 link_rx_rate: [0_u32; 6usize],
21103 link_tx_max: [0_u32; 6usize],
21104 link_rx_max: [0_u32; 6usize],
21105 fan_speed: [0_i16; 4usize],
21106 mavtype: 0_u8,
21107 cpu_cores: [0_u8; 8usize],
21108 cpu_combined: [0_u8; 10usize],
21109 gpu_cores: [0_u8; 4usize],
21110 gpu_combined: [0_u8; 10usize],
21111 temperature_board: 0_i8,
21112 temperature_core: [0_i8; 8usize],
21113 };
21114 #[cfg(feature = "arbitrary")]
21115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21116 use arbitrary::{Arbitrary, Unstructured};
21117 let mut buf = [0u8; 1024];
21118 rng.fill_bytes(&mut buf);
21119 let mut unstructured = Unstructured::new(&buf);
21120 Self::arbitrary(&mut unstructured).unwrap_or_default()
21121 }
21122}
21123impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21124 fn default() -> Self {
21125 Self::DEFAULT.clone()
21126 }
21127}
21128impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21129 type Message = MavMessage;
21130 const ID: u32 = 390u32;
21131 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21132 const EXTRA_CRC: u8 = 156u8;
21133 const ENCODED_LEN: usize = 238usize;
21134 fn deser(
21135 _version: MavlinkVersion,
21136 __input: &[u8],
21137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21138 let avail_len = __input.len();
21139 let mut payload_buf = [0; Self::ENCODED_LEN];
21140 let mut buf = if avail_len < Self::ENCODED_LEN {
21141 payload_buf[0..avail_len].copy_from_slice(__input);
21142 Bytes::new(&payload_buf)
21143 } else {
21144 Bytes::new(__input)
21145 };
21146 let mut __struct = Self::default();
21147 __struct.time_usec = buf.get_u64_le();
21148 __struct.uptime = buf.get_u32_le();
21149 __struct.ram_usage = buf.get_u32_le();
21150 __struct.ram_total = buf.get_u32_le();
21151 for v in &mut __struct.storage_type {
21152 let val = buf.get_u32_le();
21153 *v = val;
21154 }
21155 for v in &mut __struct.storage_usage {
21156 let val = buf.get_u32_le();
21157 *v = val;
21158 }
21159 for v in &mut __struct.storage_total {
21160 let val = buf.get_u32_le();
21161 *v = val;
21162 }
21163 for v in &mut __struct.link_type {
21164 let val = buf.get_u32_le();
21165 *v = val;
21166 }
21167 for v in &mut __struct.link_tx_rate {
21168 let val = buf.get_u32_le();
21169 *v = val;
21170 }
21171 for v in &mut __struct.link_rx_rate {
21172 let val = buf.get_u32_le();
21173 *v = val;
21174 }
21175 for v in &mut __struct.link_tx_max {
21176 let val = buf.get_u32_le();
21177 *v = val;
21178 }
21179 for v in &mut __struct.link_rx_max {
21180 let val = buf.get_u32_le();
21181 *v = val;
21182 }
21183 for v in &mut __struct.fan_speed {
21184 let val = buf.get_i16_le();
21185 *v = val;
21186 }
21187 __struct.mavtype = buf.get_u8();
21188 for v in &mut __struct.cpu_cores {
21189 let val = buf.get_u8();
21190 *v = val;
21191 }
21192 for v in &mut __struct.cpu_combined {
21193 let val = buf.get_u8();
21194 *v = val;
21195 }
21196 for v in &mut __struct.gpu_cores {
21197 let val = buf.get_u8();
21198 *v = val;
21199 }
21200 for v in &mut __struct.gpu_combined {
21201 let val = buf.get_u8();
21202 *v = val;
21203 }
21204 __struct.temperature_board = buf.get_i8();
21205 for v in &mut __struct.temperature_core {
21206 let val = buf.get_i8();
21207 *v = val;
21208 }
21209 Ok(__struct)
21210 }
21211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21212 let mut __tmp = BytesMut::new(bytes);
21213 #[allow(clippy::absurd_extreme_comparisons)]
21214 #[allow(unused_comparisons)]
21215 if __tmp.remaining() < Self::ENCODED_LEN {
21216 panic!(
21217 "buffer is too small (need {} bytes, but got {})",
21218 Self::ENCODED_LEN,
21219 __tmp.remaining(),
21220 )
21221 }
21222 __tmp.put_u64_le(self.time_usec);
21223 __tmp.put_u32_le(self.uptime);
21224 __tmp.put_u32_le(self.ram_usage);
21225 __tmp.put_u32_le(self.ram_total);
21226 for val in &self.storage_type {
21227 __tmp.put_u32_le(*val);
21228 }
21229 for val in &self.storage_usage {
21230 __tmp.put_u32_le(*val);
21231 }
21232 for val in &self.storage_total {
21233 __tmp.put_u32_le(*val);
21234 }
21235 for val in &self.link_type {
21236 __tmp.put_u32_le(*val);
21237 }
21238 for val in &self.link_tx_rate {
21239 __tmp.put_u32_le(*val);
21240 }
21241 for val in &self.link_rx_rate {
21242 __tmp.put_u32_le(*val);
21243 }
21244 for val in &self.link_tx_max {
21245 __tmp.put_u32_le(*val);
21246 }
21247 for val in &self.link_rx_max {
21248 __tmp.put_u32_le(*val);
21249 }
21250 for val in &self.fan_speed {
21251 __tmp.put_i16_le(*val);
21252 }
21253 __tmp.put_u8(self.mavtype);
21254 for val in &self.cpu_cores {
21255 __tmp.put_u8(*val);
21256 }
21257 for val in &self.cpu_combined {
21258 __tmp.put_u8(*val);
21259 }
21260 for val in &self.gpu_cores {
21261 __tmp.put_u8(*val);
21262 }
21263 for val in &self.gpu_combined {
21264 __tmp.put_u8(*val);
21265 }
21266 __tmp.put_i8(self.temperature_board);
21267 for val in &self.temperature_core {
21268 __tmp.put_i8(*val);
21269 }
21270 if matches!(version, MavlinkVersion::V2) {
21271 let len = __tmp.len();
21272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21273 } else {
21274 __tmp.len()
21275 }
21276 }
21277}
21278#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21279#[doc = ""]
21280#[doc = "ID: 12918"]
21281#[derive(Debug, Clone, PartialEq)]
21282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21284pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21285 #[doc = "Status level indicating if arming is allowed."]
21286 pub status: MavOdidArmStatus,
21287 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21288 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21289 pub error: [u8; 50],
21290}
21291impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21292 pub const ENCODED_LEN: usize = 51usize;
21293 pub const DEFAULT: Self = Self {
21294 status: MavOdidArmStatus::DEFAULT,
21295 error: [0_u8; 50usize],
21296 };
21297 #[cfg(feature = "arbitrary")]
21298 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21299 use arbitrary::{Arbitrary, Unstructured};
21300 let mut buf = [0u8; 1024];
21301 rng.fill_bytes(&mut buf);
21302 let mut unstructured = Unstructured::new(&buf);
21303 Self::arbitrary(&mut unstructured).unwrap_or_default()
21304 }
21305}
21306impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21307 fn default() -> Self {
21308 Self::DEFAULT.clone()
21309 }
21310}
21311impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21312 type Message = MavMessage;
21313 const ID: u32 = 12918u32;
21314 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21315 const EXTRA_CRC: u8 = 139u8;
21316 const ENCODED_LEN: usize = 51usize;
21317 fn deser(
21318 _version: MavlinkVersion,
21319 __input: &[u8],
21320 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21321 let avail_len = __input.len();
21322 let mut payload_buf = [0; Self::ENCODED_LEN];
21323 let mut buf = if avail_len < Self::ENCODED_LEN {
21324 payload_buf[0..avail_len].copy_from_slice(__input);
21325 Bytes::new(&payload_buf)
21326 } else {
21327 Bytes::new(__input)
21328 };
21329 let mut __struct = Self::default();
21330 let tmp = buf.get_u8();
21331 __struct.status =
21332 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21333 enum_type: "MavOdidArmStatus",
21334 value: tmp as u32,
21335 })?;
21336 for v in &mut __struct.error {
21337 let val = buf.get_u8();
21338 *v = val;
21339 }
21340 Ok(__struct)
21341 }
21342 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21343 let mut __tmp = BytesMut::new(bytes);
21344 #[allow(clippy::absurd_extreme_comparisons)]
21345 #[allow(unused_comparisons)]
21346 if __tmp.remaining() < Self::ENCODED_LEN {
21347 panic!(
21348 "buffer is too small (need {} bytes, but got {})",
21349 Self::ENCODED_LEN,
21350 __tmp.remaining(),
21351 )
21352 }
21353 __tmp.put_u8(self.status as u8);
21354 for val in &self.error {
21355 __tmp.put_u8(*val);
21356 }
21357 if matches!(version, MavlinkVersion::V2) {
21358 let len = __tmp.len();
21359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21360 } else {
21361 __tmp.len()
21362 }
21363 }
21364}
21365#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21366#[doc = ""]
21367#[doc = "ID: 12902"]
21368#[derive(Debug, Clone, PartialEq)]
21369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21371pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21372 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21373 pub timestamp: u32,
21374 #[doc = "System ID (0 for broadcast)."]
21375 pub target_system: u8,
21376 #[doc = "Component ID (0 for broadcast)."]
21377 pub target_component: u8,
21378 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21379 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21380 pub id_or_mac: [u8; 20],
21381 #[doc = "Indicates the type of authentication."]
21382 pub authentication_type: MavOdidAuthType,
21383 #[doc = "Allowed range is 0 - 15."]
21384 pub data_page: u8,
21385 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21386 pub last_page_index: u8,
21387 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21388 pub length: u8,
21389 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21390 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21391 pub authentication_data: [u8; 23],
21392}
21393impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21394 pub const ENCODED_LEN: usize = 53usize;
21395 pub const DEFAULT: Self = Self {
21396 timestamp: 0_u32,
21397 target_system: 0_u8,
21398 target_component: 0_u8,
21399 id_or_mac: [0_u8; 20usize],
21400 authentication_type: MavOdidAuthType::DEFAULT,
21401 data_page: 0_u8,
21402 last_page_index: 0_u8,
21403 length: 0_u8,
21404 authentication_data: [0_u8; 23usize],
21405 };
21406 #[cfg(feature = "arbitrary")]
21407 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21408 use arbitrary::{Arbitrary, Unstructured};
21409 let mut buf = [0u8; 1024];
21410 rng.fill_bytes(&mut buf);
21411 let mut unstructured = Unstructured::new(&buf);
21412 Self::arbitrary(&mut unstructured).unwrap_or_default()
21413 }
21414}
21415impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21416 fn default() -> Self {
21417 Self::DEFAULT.clone()
21418 }
21419}
21420impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21421 type Message = MavMessage;
21422 const ID: u32 = 12902u32;
21423 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21424 const EXTRA_CRC: u8 = 140u8;
21425 const ENCODED_LEN: usize = 53usize;
21426 fn deser(
21427 _version: MavlinkVersion,
21428 __input: &[u8],
21429 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21430 let avail_len = __input.len();
21431 let mut payload_buf = [0; Self::ENCODED_LEN];
21432 let mut buf = if avail_len < Self::ENCODED_LEN {
21433 payload_buf[0..avail_len].copy_from_slice(__input);
21434 Bytes::new(&payload_buf)
21435 } else {
21436 Bytes::new(__input)
21437 };
21438 let mut __struct = Self::default();
21439 __struct.timestamp = buf.get_u32_le();
21440 __struct.target_system = buf.get_u8();
21441 __struct.target_component = buf.get_u8();
21442 for v in &mut __struct.id_or_mac {
21443 let val = buf.get_u8();
21444 *v = val;
21445 }
21446 let tmp = buf.get_u8();
21447 __struct.authentication_type =
21448 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21449 enum_type: "MavOdidAuthType",
21450 value: tmp as u32,
21451 })?;
21452 __struct.data_page = buf.get_u8();
21453 __struct.last_page_index = buf.get_u8();
21454 __struct.length = buf.get_u8();
21455 for v in &mut __struct.authentication_data {
21456 let val = buf.get_u8();
21457 *v = val;
21458 }
21459 Ok(__struct)
21460 }
21461 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21462 let mut __tmp = BytesMut::new(bytes);
21463 #[allow(clippy::absurd_extreme_comparisons)]
21464 #[allow(unused_comparisons)]
21465 if __tmp.remaining() < Self::ENCODED_LEN {
21466 panic!(
21467 "buffer is too small (need {} bytes, but got {})",
21468 Self::ENCODED_LEN,
21469 __tmp.remaining(),
21470 )
21471 }
21472 __tmp.put_u32_le(self.timestamp);
21473 __tmp.put_u8(self.target_system);
21474 __tmp.put_u8(self.target_component);
21475 for val in &self.id_or_mac {
21476 __tmp.put_u8(*val);
21477 }
21478 __tmp.put_u8(self.authentication_type as u8);
21479 __tmp.put_u8(self.data_page);
21480 __tmp.put_u8(self.last_page_index);
21481 __tmp.put_u8(self.length);
21482 for val in &self.authentication_data {
21483 __tmp.put_u8(*val);
21484 }
21485 if matches!(version, MavlinkVersion::V2) {
21486 let len = __tmp.len();
21487 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21488 } else {
21489 __tmp.len()
21490 }
21491 }
21492}
21493#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21494#[doc = ""]
21495#[doc = "ID: 12900"]
21496#[derive(Debug, Clone, PartialEq)]
21497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21499pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21500 #[doc = "System ID (0 for broadcast)."]
21501 pub target_system: u8,
21502 #[doc = "Component ID (0 for broadcast)."]
21503 pub target_component: u8,
21504 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21505 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21506 pub id_or_mac: [u8; 20],
21507 #[doc = "Indicates the format for the uas_id field of this message."]
21508 pub id_type: MavOdidIdType,
21509 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21510 pub ua_type: MavOdidUaType,
21511 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21512 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21513 pub uas_id: [u8; 20],
21514}
21515impl OPEN_DRONE_ID_BASIC_ID_DATA {
21516 pub const ENCODED_LEN: usize = 44usize;
21517 pub const DEFAULT: Self = Self {
21518 target_system: 0_u8,
21519 target_component: 0_u8,
21520 id_or_mac: [0_u8; 20usize],
21521 id_type: MavOdidIdType::DEFAULT,
21522 ua_type: MavOdidUaType::DEFAULT,
21523 uas_id: [0_u8; 20usize],
21524 };
21525 #[cfg(feature = "arbitrary")]
21526 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21527 use arbitrary::{Arbitrary, Unstructured};
21528 let mut buf = [0u8; 1024];
21529 rng.fill_bytes(&mut buf);
21530 let mut unstructured = Unstructured::new(&buf);
21531 Self::arbitrary(&mut unstructured).unwrap_or_default()
21532 }
21533}
21534impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21535 fn default() -> Self {
21536 Self::DEFAULT.clone()
21537 }
21538}
21539impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21540 type Message = MavMessage;
21541 const ID: u32 = 12900u32;
21542 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21543 const EXTRA_CRC: u8 = 114u8;
21544 const ENCODED_LEN: usize = 44usize;
21545 fn deser(
21546 _version: MavlinkVersion,
21547 __input: &[u8],
21548 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21549 let avail_len = __input.len();
21550 let mut payload_buf = [0; Self::ENCODED_LEN];
21551 let mut buf = if avail_len < Self::ENCODED_LEN {
21552 payload_buf[0..avail_len].copy_from_slice(__input);
21553 Bytes::new(&payload_buf)
21554 } else {
21555 Bytes::new(__input)
21556 };
21557 let mut __struct = Self::default();
21558 __struct.target_system = buf.get_u8();
21559 __struct.target_component = buf.get_u8();
21560 for v in &mut __struct.id_or_mac {
21561 let val = buf.get_u8();
21562 *v = val;
21563 }
21564 let tmp = buf.get_u8();
21565 __struct.id_type =
21566 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21567 enum_type: "MavOdidIdType",
21568 value: tmp as u32,
21569 })?;
21570 let tmp = buf.get_u8();
21571 __struct.ua_type =
21572 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21573 enum_type: "MavOdidUaType",
21574 value: tmp as u32,
21575 })?;
21576 for v in &mut __struct.uas_id {
21577 let val = buf.get_u8();
21578 *v = val;
21579 }
21580 Ok(__struct)
21581 }
21582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21583 let mut __tmp = BytesMut::new(bytes);
21584 #[allow(clippy::absurd_extreme_comparisons)]
21585 #[allow(unused_comparisons)]
21586 if __tmp.remaining() < Self::ENCODED_LEN {
21587 panic!(
21588 "buffer is too small (need {} bytes, but got {})",
21589 Self::ENCODED_LEN,
21590 __tmp.remaining(),
21591 )
21592 }
21593 __tmp.put_u8(self.target_system);
21594 __tmp.put_u8(self.target_component);
21595 for val in &self.id_or_mac {
21596 __tmp.put_u8(*val);
21597 }
21598 __tmp.put_u8(self.id_type as u8);
21599 __tmp.put_u8(self.ua_type as u8);
21600 for val in &self.uas_id {
21601 __tmp.put_u8(*val);
21602 }
21603 if matches!(version, MavlinkVersion::V2) {
21604 let len = __tmp.len();
21605 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21606 } else {
21607 __tmp.len()
21608 }
21609 }
21610}
21611#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21612#[doc = ""]
21613#[doc = "ID: 12901"]
21614#[derive(Debug, Clone, PartialEq)]
21615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21617pub struct OPEN_DRONE_ID_LOCATION_DATA {
21618 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21619 pub latitude: i32,
21620 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21621 pub longitude: i32,
21622 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21623 pub altitude_barometric: f32,
21624 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21625 pub altitude_geodetic: f32,
21626 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21627 pub height: f32,
21628 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21629 pub timestamp: f32,
21630 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21631 pub direction: u16,
21632 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21633 pub speed_horizontal: u16,
21634 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21635 pub speed_vertical: i16,
21636 #[doc = "System ID (0 for broadcast)."]
21637 pub target_system: u8,
21638 #[doc = "Component ID (0 for broadcast)."]
21639 pub target_component: u8,
21640 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21641 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21642 pub id_or_mac: [u8; 20],
21643 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21644 pub status: MavOdidStatus,
21645 #[doc = "Indicates the reference point for the height field."]
21646 pub height_reference: MavOdidHeightRef,
21647 #[doc = "The accuracy of the horizontal position."]
21648 pub horizontal_accuracy: MavOdidHorAcc,
21649 #[doc = "The accuracy of the vertical position."]
21650 pub vertical_accuracy: MavOdidVerAcc,
21651 #[doc = "The accuracy of the barometric altitude."]
21652 pub barometer_accuracy: MavOdidVerAcc,
21653 #[doc = "The accuracy of the horizontal and vertical speed."]
21654 pub speed_accuracy: MavOdidSpeedAcc,
21655 #[doc = "The accuracy of the timestamps."]
21656 pub timestamp_accuracy: MavOdidTimeAcc,
21657}
21658impl OPEN_DRONE_ID_LOCATION_DATA {
21659 pub const ENCODED_LEN: usize = 59usize;
21660 pub const DEFAULT: Self = Self {
21661 latitude: 0_i32,
21662 longitude: 0_i32,
21663 altitude_barometric: 0.0_f32,
21664 altitude_geodetic: 0.0_f32,
21665 height: 0.0_f32,
21666 timestamp: 0.0_f32,
21667 direction: 0_u16,
21668 speed_horizontal: 0_u16,
21669 speed_vertical: 0_i16,
21670 target_system: 0_u8,
21671 target_component: 0_u8,
21672 id_or_mac: [0_u8; 20usize],
21673 status: MavOdidStatus::DEFAULT,
21674 height_reference: MavOdidHeightRef::DEFAULT,
21675 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21676 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21677 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21678 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21679 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21680 };
21681 #[cfg(feature = "arbitrary")]
21682 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21683 use arbitrary::{Arbitrary, Unstructured};
21684 let mut buf = [0u8; 1024];
21685 rng.fill_bytes(&mut buf);
21686 let mut unstructured = Unstructured::new(&buf);
21687 Self::arbitrary(&mut unstructured).unwrap_or_default()
21688 }
21689}
21690impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21691 fn default() -> Self {
21692 Self::DEFAULT.clone()
21693 }
21694}
21695impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21696 type Message = MavMessage;
21697 const ID: u32 = 12901u32;
21698 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21699 const EXTRA_CRC: u8 = 254u8;
21700 const ENCODED_LEN: usize = 59usize;
21701 fn deser(
21702 _version: MavlinkVersion,
21703 __input: &[u8],
21704 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21705 let avail_len = __input.len();
21706 let mut payload_buf = [0; Self::ENCODED_LEN];
21707 let mut buf = if avail_len < Self::ENCODED_LEN {
21708 payload_buf[0..avail_len].copy_from_slice(__input);
21709 Bytes::new(&payload_buf)
21710 } else {
21711 Bytes::new(__input)
21712 };
21713 let mut __struct = Self::default();
21714 __struct.latitude = buf.get_i32_le();
21715 __struct.longitude = buf.get_i32_le();
21716 __struct.altitude_barometric = buf.get_f32_le();
21717 __struct.altitude_geodetic = buf.get_f32_le();
21718 __struct.height = buf.get_f32_le();
21719 __struct.timestamp = buf.get_f32_le();
21720 __struct.direction = buf.get_u16_le();
21721 __struct.speed_horizontal = buf.get_u16_le();
21722 __struct.speed_vertical = buf.get_i16_le();
21723 __struct.target_system = buf.get_u8();
21724 __struct.target_component = buf.get_u8();
21725 for v in &mut __struct.id_or_mac {
21726 let val = buf.get_u8();
21727 *v = val;
21728 }
21729 let tmp = buf.get_u8();
21730 __struct.status =
21731 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21732 enum_type: "MavOdidStatus",
21733 value: tmp as u32,
21734 })?;
21735 let tmp = buf.get_u8();
21736 __struct.height_reference =
21737 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21738 enum_type: "MavOdidHeightRef",
21739 value: tmp as u32,
21740 })?;
21741 let tmp = buf.get_u8();
21742 __struct.horizontal_accuracy =
21743 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21744 enum_type: "MavOdidHorAcc",
21745 value: tmp as u32,
21746 })?;
21747 let tmp = buf.get_u8();
21748 __struct.vertical_accuracy =
21749 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21750 enum_type: "MavOdidVerAcc",
21751 value: tmp as u32,
21752 })?;
21753 let tmp = buf.get_u8();
21754 __struct.barometer_accuracy =
21755 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21756 enum_type: "MavOdidVerAcc",
21757 value: tmp as u32,
21758 })?;
21759 let tmp = buf.get_u8();
21760 __struct.speed_accuracy =
21761 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21762 enum_type: "MavOdidSpeedAcc",
21763 value: tmp as u32,
21764 })?;
21765 let tmp = buf.get_u8();
21766 __struct.timestamp_accuracy =
21767 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21768 enum_type: "MavOdidTimeAcc",
21769 value: tmp as u32,
21770 })?;
21771 Ok(__struct)
21772 }
21773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21774 let mut __tmp = BytesMut::new(bytes);
21775 #[allow(clippy::absurd_extreme_comparisons)]
21776 #[allow(unused_comparisons)]
21777 if __tmp.remaining() < Self::ENCODED_LEN {
21778 panic!(
21779 "buffer is too small (need {} bytes, but got {})",
21780 Self::ENCODED_LEN,
21781 __tmp.remaining(),
21782 )
21783 }
21784 __tmp.put_i32_le(self.latitude);
21785 __tmp.put_i32_le(self.longitude);
21786 __tmp.put_f32_le(self.altitude_barometric);
21787 __tmp.put_f32_le(self.altitude_geodetic);
21788 __tmp.put_f32_le(self.height);
21789 __tmp.put_f32_le(self.timestamp);
21790 __tmp.put_u16_le(self.direction);
21791 __tmp.put_u16_le(self.speed_horizontal);
21792 __tmp.put_i16_le(self.speed_vertical);
21793 __tmp.put_u8(self.target_system);
21794 __tmp.put_u8(self.target_component);
21795 for val in &self.id_or_mac {
21796 __tmp.put_u8(*val);
21797 }
21798 __tmp.put_u8(self.status as u8);
21799 __tmp.put_u8(self.height_reference as u8);
21800 __tmp.put_u8(self.horizontal_accuracy as u8);
21801 __tmp.put_u8(self.vertical_accuracy as u8);
21802 __tmp.put_u8(self.barometer_accuracy as u8);
21803 __tmp.put_u8(self.speed_accuracy as u8);
21804 __tmp.put_u8(self.timestamp_accuracy as u8);
21805 if matches!(version, MavlinkVersion::V2) {
21806 let len = __tmp.len();
21807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21808 } else {
21809 __tmp.len()
21810 }
21811 }
21812}
21813#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
21814#[doc = ""]
21815#[doc = "ID: 12915"]
21816#[derive(Debug, Clone, PartialEq)]
21817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21819pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21820 #[doc = "System ID (0 for broadcast)."]
21821 pub target_system: u8,
21822 #[doc = "Component ID (0 for broadcast)."]
21823 pub target_component: u8,
21824 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21825 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21826 pub id_or_mac: [u8; 20],
21827 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
21828 pub single_message_size: u8,
21829 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
21830 pub msg_pack_size: u8,
21831 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
21832 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21833 pub messages: [u8; 225],
21834}
21835impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21836 pub const ENCODED_LEN: usize = 249usize;
21837 pub const DEFAULT: Self = Self {
21838 target_system: 0_u8,
21839 target_component: 0_u8,
21840 id_or_mac: [0_u8; 20usize],
21841 single_message_size: 0_u8,
21842 msg_pack_size: 0_u8,
21843 messages: [0_u8; 225usize],
21844 };
21845 #[cfg(feature = "arbitrary")]
21846 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21847 use arbitrary::{Arbitrary, Unstructured};
21848 let mut buf = [0u8; 1024];
21849 rng.fill_bytes(&mut buf);
21850 let mut unstructured = Unstructured::new(&buf);
21851 Self::arbitrary(&mut unstructured).unwrap_or_default()
21852 }
21853}
21854impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21855 fn default() -> Self {
21856 Self::DEFAULT.clone()
21857 }
21858}
21859impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21860 type Message = MavMessage;
21861 const ID: u32 = 12915u32;
21862 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
21863 const EXTRA_CRC: u8 = 94u8;
21864 const ENCODED_LEN: usize = 249usize;
21865 fn deser(
21866 _version: MavlinkVersion,
21867 __input: &[u8],
21868 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21869 let avail_len = __input.len();
21870 let mut payload_buf = [0; Self::ENCODED_LEN];
21871 let mut buf = if avail_len < Self::ENCODED_LEN {
21872 payload_buf[0..avail_len].copy_from_slice(__input);
21873 Bytes::new(&payload_buf)
21874 } else {
21875 Bytes::new(__input)
21876 };
21877 let mut __struct = Self::default();
21878 __struct.target_system = buf.get_u8();
21879 __struct.target_component = buf.get_u8();
21880 for v in &mut __struct.id_or_mac {
21881 let val = buf.get_u8();
21882 *v = val;
21883 }
21884 __struct.single_message_size = buf.get_u8();
21885 __struct.msg_pack_size = buf.get_u8();
21886 for v in &mut __struct.messages {
21887 let val = buf.get_u8();
21888 *v = val;
21889 }
21890 Ok(__struct)
21891 }
21892 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21893 let mut __tmp = BytesMut::new(bytes);
21894 #[allow(clippy::absurd_extreme_comparisons)]
21895 #[allow(unused_comparisons)]
21896 if __tmp.remaining() < Self::ENCODED_LEN {
21897 panic!(
21898 "buffer is too small (need {} bytes, but got {})",
21899 Self::ENCODED_LEN,
21900 __tmp.remaining(),
21901 )
21902 }
21903 __tmp.put_u8(self.target_system);
21904 __tmp.put_u8(self.target_component);
21905 for val in &self.id_or_mac {
21906 __tmp.put_u8(*val);
21907 }
21908 __tmp.put_u8(self.single_message_size);
21909 __tmp.put_u8(self.msg_pack_size);
21910 for val in &self.messages {
21911 __tmp.put_u8(*val);
21912 }
21913 if matches!(version, MavlinkVersion::V2) {
21914 let len = __tmp.len();
21915 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21916 } else {
21917 __tmp.len()
21918 }
21919 }
21920}
21921#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
21922#[doc = ""]
21923#[doc = "ID: 12905"]
21924#[derive(Debug, Clone, PartialEq)]
21925#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21926#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21927pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
21928 #[doc = "System ID (0 for broadcast)."]
21929 pub target_system: u8,
21930 #[doc = "Component ID (0 for broadcast)."]
21931 pub target_component: u8,
21932 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21933 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21934 pub id_or_mac: [u8; 20],
21935 #[doc = "Indicates the type of the operator_id field."]
21936 pub operator_id_type: MavOdidOperatorIdType,
21937 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21938 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21939 pub operator_id: [u8; 20],
21940}
21941impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
21942 pub const ENCODED_LEN: usize = 43usize;
21943 pub const DEFAULT: Self = Self {
21944 target_system: 0_u8,
21945 target_component: 0_u8,
21946 id_or_mac: [0_u8; 20usize],
21947 operator_id_type: MavOdidOperatorIdType::DEFAULT,
21948 operator_id: [0_u8; 20usize],
21949 };
21950 #[cfg(feature = "arbitrary")]
21951 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21952 use arbitrary::{Arbitrary, Unstructured};
21953 let mut buf = [0u8; 1024];
21954 rng.fill_bytes(&mut buf);
21955 let mut unstructured = Unstructured::new(&buf);
21956 Self::arbitrary(&mut unstructured).unwrap_or_default()
21957 }
21958}
21959impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21960 fn default() -> Self {
21961 Self::DEFAULT.clone()
21962 }
21963}
21964impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21965 type Message = MavMessage;
21966 const ID: u32 = 12905u32;
21967 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
21968 const EXTRA_CRC: u8 = 49u8;
21969 const ENCODED_LEN: usize = 43usize;
21970 fn deser(
21971 _version: MavlinkVersion,
21972 __input: &[u8],
21973 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21974 let avail_len = __input.len();
21975 let mut payload_buf = [0; Self::ENCODED_LEN];
21976 let mut buf = if avail_len < Self::ENCODED_LEN {
21977 payload_buf[0..avail_len].copy_from_slice(__input);
21978 Bytes::new(&payload_buf)
21979 } else {
21980 Bytes::new(__input)
21981 };
21982 let mut __struct = Self::default();
21983 __struct.target_system = buf.get_u8();
21984 __struct.target_component = buf.get_u8();
21985 for v in &mut __struct.id_or_mac {
21986 let val = buf.get_u8();
21987 *v = val;
21988 }
21989 let tmp = buf.get_u8();
21990 __struct.operator_id_type =
21991 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21992 enum_type: "MavOdidOperatorIdType",
21993 value: tmp as u32,
21994 })?;
21995 for v in &mut __struct.operator_id {
21996 let val = buf.get_u8();
21997 *v = val;
21998 }
21999 Ok(__struct)
22000 }
22001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22002 let mut __tmp = BytesMut::new(bytes);
22003 #[allow(clippy::absurd_extreme_comparisons)]
22004 #[allow(unused_comparisons)]
22005 if __tmp.remaining() < Self::ENCODED_LEN {
22006 panic!(
22007 "buffer is too small (need {} bytes, but got {})",
22008 Self::ENCODED_LEN,
22009 __tmp.remaining(),
22010 )
22011 }
22012 __tmp.put_u8(self.target_system);
22013 __tmp.put_u8(self.target_component);
22014 for val in &self.id_or_mac {
22015 __tmp.put_u8(*val);
22016 }
22017 __tmp.put_u8(self.operator_id_type as u8);
22018 for val in &self.operator_id {
22019 __tmp.put_u8(*val);
22020 }
22021 if matches!(version, MavlinkVersion::V2) {
22022 let len = __tmp.len();
22023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22024 } else {
22025 __tmp.len()
22026 }
22027 }
22028}
22029#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22030#[doc = ""]
22031#[doc = "ID: 12903"]
22032#[derive(Debug, Clone, PartialEq)]
22033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22035pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22036 #[doc = "System ID (0 for broadcast)."]
22037 pub target_system: u8,
22038 #[doc = "Component ID (0 for broadcast)."]
22039 pub target_component: u8,
22040 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22041 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22042 pub id_or_mac: [u8; 20],
22043 #[doc = "Indicates the type of the description field."]
22044 pub description_type: MavOdidDescType,
22045 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22046 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22047 pub description: [u8; 23],
22048}
22049impl OPEN_DRONE_ID_SELF_ID_DATA {
22050 pub const ENCODED_LEN: usize = 46usize;
22051 pub const DEFAULT: Self = Self {
22052 target_system: 0_u8,
22053 target_component: 0_u8,
22054 id_or_mac: [0_u8; 20usize],
22055 description_type: MavOdidDescType::DEFAULT,
22056 description: [0_u8; 23usize],
22057 };
22058 #[cfg(feature = "arbitrary")]
22059 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22060 use arbitrary::{Arbitrary, Unstructured};
22061 let mut buf = [0u8; 1024];
22062 rng.fill_bytes(&mut buf);
22063 let mut unstructured = Unstructured::new(&buf);
22064 Self::arbitrary(&mut unstructured).unwrap_or_default()
22065 }
22066}
22067impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22068 fn default() -> Self {
22069 Self::DEFAULT.clone()
22070 }
22071}
22072impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22073 type Message = MavMessage;
22074 const ID: u32 = 12903u32;
22075 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22076 const EXTRA_CRC: u8 = 249u8;
22077 const ENCODED_LEN: usize = 46usize;
22078 fn deser(
22079 _version: MavlinkVersion,
22080 __input: &[u8],
22081 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22082 let avail_len = __input.len();
22083 let mut payload_buf = [0; Self::ENCODED_LEN];
22084 let mut buf = if avail_len < Self::ENCODED_LEN {
22085 payload_buf[0..avail_len].copy_from_slice(__input);
22086 Bytes::new(&payload_buf)
22087 } else {
22088 Bytes::new(__input)
22089 };
22090 let mut __struct = Self::default();
22091 __struct.target_system = buf.get_u8();
22092 __struct.target_component = buf.get_u8();
22093 for v in &mut __struct.id_or_mac {
22094 let val = buf.get_u8();
22095 *v = val;
22096 }
22097 let tmp = buf.get_u8();
22098 __struct.description_type =
22099 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22100 enum_type: "MavOdidDescType",
22101 value: tmp as u32,
22102 })?;
22103 for v in &mut __struct.description {
22104 let val = buf.get_u8();
22105 *v = val;
22106 }
22107 Ok(__struct)
22108 }
22109 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22110 let mut __tmp = BytesMut::new(bytes);
22111 #[allow(clippy::absurd_extreme_comparisons)]
22112 #[allow(unused_comparisons)]
22113 if __tmp.remaining() < Self::ENCODED_LEN {
22114 panic!(
22115 "buffer is too small (need {} bytes, but got {})",
22116 Self::ENCODED_LEN,
22117 __tmp.remaining(),
22118 )
22119 }
22120 __tmp.put_u8(self.target_system);
22121 __tmp.put_u8(self.target_component);
22122 for val in &self.id_or_mac {
22123 __tmp.put_u8(*val);
22124 }
22125 __tmp.put_u8(self.description_type as u8);
22126 for val in &self.description {
22127 __tmp.put_u8(*val);
22128 }
22129 if matches!(version, MavlinkVersion::V2) {
22130 let len = __tmp.len();
22131 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22132 } else {
22133 __tmp.len()
22134 }
22135 }
22136}
22137#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22138#[doc = ""]
22139#[doc = "ID: 12904"]
22140#[derive(Debug, Clone, PartialEq)]
22141#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22143pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22144 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22145 pub operator_latitude: i32,
22146 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22147 pub operator_longitude: i32,
22148 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22149 pub area_ceiling: f32,
22150 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22151 pub area_floor: f32,
22152 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22153 pub operator_altitude_geo: f32,
22154 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22155 pub timestamp: u32,
22156 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22157 pub area_count: u16,
22158 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22159 pub area_radius: u16,
22160 #[doc = "System ID (0 for broadcast)."]
22161 pub target_system: u8,
22162 #[doc = "Component ID (0 for broadcast)."]
22163 pub target_component: u8,
22164 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22165 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22166 pub id_or_mac: [u8; 20],
22167 #[doc = "Specifies the operator location type."]
22168 pub operator_location_type: MavOdidOperatorLocationType,
22169 #[doc = "Specifies the classification type of the UA."]
22170 pub classification_type: MavOdidClassificationType,
22171 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22172 pub category_eu: MavOdidCategoryEu,
22173 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22174 pub class_eu: MavOdidClassEu,
22175}
22176impl OPEN_DRONE_ID_SYSTEM_DATA {
22177 pub const ENCODED_LEN: usize = 54usize;
22178 pub const DEFAULT: Self = Self {
22179 operator_latitude: 0_i32,
22180 operator_longitude: 0_i32,
22181 area_ceiling: 0.0_f32,
22182 area_floor: 0.0_f32,
22183 operator_altitude_geo: 0.0_f32,
22184 timestamp: 0_u32,
22185 area_count: 0_u16,
22186 area_radius: 0_u16,
22187 target_system: 0_u8,
22188 target_component: 0_u8,
22189 id_or_mac: [0_u8; 20usize],
22190 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22191 classification_type: MavOdidClassificationType::DEFAULT,
22192 category_eu: MavOdidCategoryEu::DEFAULT,
22193 class_eu: MavOdidClassEu::DEFAULT,
22194 };
22195 #[cfg(feature = "arbitrary")]
22196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22197 use arbitrary::{Arbitrary, Unstructured};
22198 let mut buf = [0u8; 1024];
22199 rng.fill_bytes(&mut buf);
22200 let mut unstructured = Unstructured::new(&buf);
22201 Self::arbitrary(&mut unstructured).unwrap_or_default()
22202 }
22203}
22204impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22205 fn default() -> Self {
22206 Self::DEFAULT.clone()
22207 }
22208}
22209impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22210 type Message = MavMessage;
22211 const ID: u32 = 12904u32;
22212 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22213 const EXTRA_CRC: u8 = 77u8;
22214 const ENCODED_LEN: usize = 54usize;
22215 fn deser(
22216 _version: MavlinkVersion,
22217 __input: &[u8],
22218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22219 let avail_len = __input.len();
22220 let mut payload_buf = [0; Self::ENCODED_LEN];
22221 let mut buf = if avail_len < Self::ENCODED_LEN {
22222 payload_buf[0..avail_len].copy_from_slice(__input);
22223 Bytes::new(&payload_buf)
22224 } else {
22225 Bytes::new(__input)
22226 };
22227 let mut __struct = Self::default();
22228 __struct.operator_latitude = buf.get_i32_le();
22229 __struct.operator_longitude = buf.get_i32_le();
22230 __struct.area_ceiling = buf.get_f32_le();
22231 __struct.area_floor = buf.get_f32_le();
22232 __struct.operator_altitude_geo = buf.get_f32_le();
22233 __struct.timestamp = buf.get_u32_le();
22234 __struct.area_count = buf.get_u16_le();
22235 __struct.area_radius = buf.get_u16_le();
22236 __struct.target_system = buf.get_u8();
22237 __struct.target_component = buf.get_u8();
22238 for v in &mut __struct.id_or_mac {
22239 let val = buf.get_u8();
22240 *v = val;
22241 }
22242 let tmp = buf.get_u8();
22243 __struct.operator_location_type =
22244 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22245 enum_type: "MavOdidOperatorLocationType",
22246 value: tmp as u32,
22247 })?;
22248 let tmp = buf.get_u8();
22249 __struct.classification_type =
22250 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22251 enum_type: "MavOdidClassificationType",
22252 value: tmp as u32,
22253 })?;
22254 let tmp = buf.get_u8();
22255 __struct.category_eu =
22256 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22257 enum_type: "MavOdidCategoryEu",
22258 value: tmp as u32,
22259 })?;
22260 let tmp = buf.get_u8();
22261 __struct.class_eu =
22262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22263 enum_type: "MavOdidClassEu",
22264 value: tmp as u32,
22265 })?;
22266 Ok(__struct)
22267 }
22268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22269 let mut __tmp = BytesMut::new(bytes);
22270 #[allow(clippy::absurd_extreme_comparisons)]
22271 #[allow(unused_comparisons)]
22272 if __tmp.remaining() < Self::ENCODED_LEN {
22273 panic!(
22274 "buffer is too small (need {} bytes, but got {})",
22275 Self::ENCODED_LEN,
22276 __tmp.remaining(),
22277 )
22278 }
22279 __tmp.put_i32_le(self.operator_latitude);
22280 __tmp.put_i32_le(self.operator_longitude);
22281 __tmp.put_f32_le(self.area_ceiling);
22282 __tmp.put_f32_le(self.area_floor);
22283 __tmp.put_f32_le(self.operator_altitude_geo);
22284 __tmp.put_u32_le(self.timestamp);
22285 __tmp.put_u16_le(self.area_count);
22286 __tmp.put_u16_le(self.area_radius);
22287 __tmp.put_u8(self.target_system);
22288 __tmp.put_u8(self.target_component);
22289 for val in &self.id_or_mac {
22290 __tmp.put_u8(*val);
22291 }
22292 __tmp.put_u8(self.operator_location_type as u8);
22293 __tmp.put_u8(self.classification_type as u8);
22294 __tmp.put_u8(self.category_eu as u8);
22295 __tmp.put_u8(self.class_eu as u8);
22296 if matches!(version, MavlinkVersion::V2) {
22297 let len = __tmp.len();
22298 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22299 } else {
22300 __tmp.len()
22301 }
22302 }
22303}
22304#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22305#[doc = ""]
22306#[doc = "ID: 12919"]
22307#[derive(Debug, Clone, PartialEq)]
22308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22310pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22311 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22312 pub operator_latitude: i32,
22313 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22314 pub operator_longitude: i32,
22315 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22316 pub operator_altitude_geo: f32,
22317 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22318 pub timestamp: u32,
22319 #[doc = "System ID (0 for broadcast)."]
22320 pub target_system: u8,
22321 #[doc = "Component ID (0 for broadcast)."]
22322 pub target_component: u8,
22323}
22324impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22325 pub const ENCODED_LEN: usize = 18usize;
22326 pub const DEFAULT: Self = Self {
22327 operator_latitude: 0_i32,
22328 operator_longitude: 0_i32,
22329 operator_altitude_geo: 0.0_f32,
22330 timestamp: 0_u32,
22331 target_system: 0_u8,
22332 target_component: 0_u8,
22333 };
22334 #[cfg(feature = "arbitrary")]
22335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22336 use arbitrary::{Arbitrary, Unstructured};
22337 let mut buf = [0u8; 1024];
22338 rng.fill_bytes(&mut buf);
22339 let mut unstructured = Unstructured::new(&buf);
22340 Self::arbitrary(&mut unstructured).unwrap_or_default()
22341 }
22342}
22343impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22344 fn default() -> Self {
22345 Self::DEFAULT.clone()
22346 }
22347}
22348impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22349 type Message = MavMessage;
22350 const ID: u32 = 12919u32;
22351 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22352 const EXTRA_CRC: u8 = 7u8;
22353 const ENCODED_LEN: usize = 18usize;
22354 fn deser(
22355 _version: MavlinkVersion,
22356 __input: &[u8],
22357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22358 let avail_len = __input.len();
22359 let mut payload_buf = [0; Self::ENCODED_LEN];
22360 let mut buf = if avail_len < Self::ENCODED_LEN {
22361 payload_buf[0..avail_len].copy_from_slice(__input);
22362 Bytes::new(&payload_buf)
22363 } else {
22364 Bytes::new(__input)
22365 };
22366 let mut __struct = Self::default();
22367 __struct.operator_latitude = buf.get_i32_le();
22368 __struct.operator_longitude = buf.get_i32_le();
22369 __struct.operator_altitude_geo = buf.get_f32_le();
22370 __struct.timestamp = buf.get_u32_le();
22371 __struct.target_system = buf.get_u8();
22372 __struct.target_component = buf.get_u8();
22373 Ok(__struct)
22374 }
22375 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22376 let mut __tmp = BytesMut::new(bytes);
22377 #[allow(clippy::absurd_extreme_comparisons)]
22378 #[allow(unused_comparisons)]
22379 if __tmp.remaining() < Self::ENCODED_LEN {
22380 panic!(
22381 "buffer is too small (need {} bytes, but got {})",
22382 Self::ENCODED_LEN,
22383 __tmp.remaining(),
22384 )
22385 }
22386 __tmp.put_i32_le(self.operator_latitude);
22387 __tmp.put_i32_le(self.operator_longitude);
22388 __tmp.put_f32_le(self.operator_altitude_geo);
22389 __tmp.put_u32_le(self.timestamp);
22390 __tmp.put_u8(self.target_system);
22391 __tmp.put_u8(self.target_component);
22392 if matches!(version, MavlinkVersion::V2) {
22393 let len = __tmp.len();
22394 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22395 } else {
22396 __tmp.len()
22397 }
22398 }
22399}
22400#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22401#[doc = ""]
22402#[doc = "ID: 100"]
22403#[derive(Debug, Clone, PartialEq)]
22404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22406pub struct OPTICAL_FLOW_DATA {
22407 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22408 pub time_usec: u64,
22409 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22410 pub flow_comp_m_x: f32,
22411 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22412 pub flow_comp_m_y: f32,
22413 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22414 pub ground_distance: f32,
22415 #[doc = "Flow in x-sensor direction"]
22416 pub flow_x: i16,
22417 #[doc = "Flow in y-sensor direction"]
22418 pub flow_y: i16,
22419 #[doc = "Sensor ID"]
22420 pub sensor_id: u8,
22421 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22422 pub quality: u8,
22423 #[doc = "Flow rate about X axis"]
22424 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22425 pub flow_rate_x: f32,
22426 #[doc = "Flow rate about Y axis"]
22427 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22428 pub flow_rate_y: f32,
22429}
22430impl OPTICAL_FLOW_DATA {
22431 pub const ENCODED_LEN: usize = 34usize;
22432 pub const DEFAULT: Self = Self {
22433 time_usec: 0_u64,
22434 flow_comp_m_x: 0.0_f32,
22435 flow_comp_m_y: 0.0_f32,
22436 ground_distance: 0.0_f32,
22437 flow_x: 0_i16,
22438 flow_y: 0_i16,
22439 sensor_id: 0_u8,
22440 quality: 0_u8,
22441 flow_rate_x: 0.0_f32,
22442 flow_rate_y: 0.0_f32,
22443 };
22444 #[cfg(feature = "arbitrary")]
22445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22446 use arbitrary::{Arbitrary, Unstructured};
22447 let mut buf = [0u8; 1024];
22448 rng.fill_bytes(&mut buf);
22449 let mut unstructured = Unstructured::new(&buf);
22450 Self::arbitrary(&mut unstructured).unwrap_or_default()
22451 }
22452}
22453impl Default for OPTICAL_FLOW_DATA {
22454 fn default() -> Self {
22455 Self::DEFAULT.clone()
22456 }
22457}
22458impl MessageData for OPTICAL_FLOW_DATA {
22459 type Message = MavMessage;
22460 const ID: u32 = 100u32;
22461 const NAME: &'static str = "OPTICAL_FLOW";
22462 const EXTRA_CRC: u8 = 175u8;
22463 const ENCODED_LEN: usize = 34usize;
22464 fn deser(
22465 _version: MavlinkVersion,
22466 __input: &[u8],
22467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22468 let avail_len = __input.len();
22469 let mut payload_buf = [0; Self::ENCODED_LEN];
22470 let mut buf = if avail_len < Self::ENCODED_LEN {
22471 payload_buf[0..avail_len].copy_from_slice(__input);
22472 Bytes::new(&payload_buf)
22473 } else {
22474 Bytes::new(__input)
22475 };
22476 let mut __struct = Self::default();
22477 __struct.time_usec = buf.get_u64_le();
22478 __struct.flow_comp_m_x = buf.get_f32_le();
22479 __struct.flow_comp_m_y = buf.get_f32_le();
22480 __struct.ground_distance = buf.get_f32_le();
22481 __struct.flow_x = buf.get_i16_le();
22482 __struct.flow_y = buf.get_i16_le();
22483 __struct.sensor_id = buf.get_u8();
22484 __struct.quality = buf.get_u8();
22485 __struct.flow_rate_x = buf.get_f32_le();
22486 __struct.flow_rate_y = buf.get_f32_le();
22487 Ok(__struct)
22488 }
22489 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22490 let mut __tmp = BytesMut::new(bytes);
22491 #[allow(clippy::absurd_extreme_comparisons)]
22492 #[allow(unused_comparisons)]
22493 if __tmp.remaining() < Self::ENCODED_LEN {
22494 panic!(
22495 "buffer is too small (need {} bytes, but got {})",
22496 Self::ENCODED_LEN,
22497 __tmp.remaining(),
22498 )
22499 }
22500 __tmp.put_u64_le(self.time_usec);
22501 __tmp.put_f32_le(self.flow_comp_m_x);
22502 __tmp.put_f32_le(self.flow_comp_m_y);
22503 __tmp.put_f32_le(self.ground_distance);
22504 __tmp.put_i16_le(self.flow_x);
22505 __tmp.put_i16_le(self.flow_y);
22506 __tmp.put_u8(self.sensor_id);
22507 __tmp.put_u8(self.quality);
22508 if matches!(version, MavlinkVersion::V2) {
22509 __tmp.put_f32_le(self.flow_rate_x);
22510 __tmp.put_f32_le(self.flow_rate_y);
22511 let len = __tmp.len();
22512 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22513 } else {
22514 __tmp.len()
22515 }
22516 }
22517}
22518#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22519#[doc = ""]
22520#[doc = "ID: 106"]
22521#[derive(Debug, Clone, PartialEq)]
22522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22524pub struct OPTICAL_FLOW_RAD_DATA {
22525 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22526 pub time_usec: u64,
22527 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22528 pub integration_time_us: u32,
22529 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22530 pub integrated_x: f32,
22531 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22532 pub integrated_y: f32,
22533 #[doc = "RH rotation around X axis"]
22534 pub integrated_xgyro: f32,
22535 #[doc = "RH rotation around Y axis"]
22536 pub integrated_ygyro: f32,
22537 #[doc = "RH rotation around Z axis"]
22538 pub integrated_zgyro: f32,
22539 #[doc = "Time since the distance was sampled."]
22540 pub time_delta_distance_us: u32,
22541 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22542 pub distance: f32,
22543 #[doc = "Temperature"]
22544 pub temperature: i16,
22545 #[doc = "Sensor ID"]
22546 pub sensor_id: u8,
22547 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22548 pub quality: u8,
22549}
22550impl OPTICAL_FLOW_RAD_DATA {
22551 pub const ENCODED_LEN: usize = 44usize;
22552 pub const DEFAULT: Self = Self {
22553 time_usec: 0_u64,
22554 integration_time_us: 0_u32,
22555 integrated_x: 0.0_f32,
22556 integrated_y: 0.0_f32,
22557 integrated_xgyro: 0.0_f32,
22558 integrated_ygyro: 0.0_f32,
22559 integrated_zgyro: 0.0_f32,
22560 time_delta_distance_us: 0_u32,
22561 distance: 0.0_f32,
22562 temperature: 0_i16,
22563 sensor_id: 0_u8,
22564 quality: 0_u8,
22565 };
22566 #[cfg(feature = "arbitrary")]
22567 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22568 use arbitrary::{Arbitrary, Unstructured};
22569 let mut buf = [0u8; 1024];
22570 rng.fill_bytes(&mut buf);
22571 let mut unstructured = Unstructured::new(&buf);
22572 Self::arbitrary(&mut unstructured).unwrap_or_default()
22573 }
22574}
22575impl Default for OPTICAL_FLOW_RAD_DATA {
22576 fn default() -> Self {
22577 Self::DEFAULT.clone()
22578 }
22579}
22580impl MessageData for OPTICAL_FLOW_RAD_DATA {
22581 type Message = MavMessage;
22582 const ID: u32 = 106u32;
22583 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22584 const EXTRA_CRC: u8 = 138u8;
22585 const ENCODED_LEN: usize = 44usize;
22586 fn deser(
22587 _version: MavlinkVersion,
22588 __input: &[u8],
22589 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22590 let avail_len = __input.len();
22591 let mut payload_buf = [0; Self::ENCODED_LEN];
22592 let mut buf = if avail_len < Self::ENCODED_LEN {
22593 payload_buf[0..avail_len].copy_from_slice(__input);
22594 Bytes::new(&payload_buf)
22595 } else {
22596 Bytes::new(__input)
22597 };
22598 let mut __struct = Self::default();
22599 __struct.time_usec = buf.get_u64_le();
22600 __struct.integration_time_us = buf.get_u32_le();
22601 __struct.integrated_x = buf.get_f32_le();
22602 __struct.integrated_y = buf.get_f32_le();
22603 __struct.integrated_xgyro = buf.get_f32_le();
22604 __struct.integrated_ygyro = buf.get_f32_le();
22605 __struct.integrated_zgyro = buf.get_f32_le();
22606 __struct.time_delta_distance_us = buf.get_u32_le();
22607 __struct.distance = buf.get_f32_le();
22608 __struct.temperature = buf.get_i16_le();
22609 __struct.sensor_id = buf.get_u8();
22610 __struct.quality = buf.get_u8();
22611 Ok(__struct)
22612 }
22613 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22614 let mut __tmp = BytesMut::new(bytes);
22615 #[allow(clippy::absurd_extreme_comparisons)]
22616 #[allow(unused_comparisons)]
22617 if __tmp.remaining() < Self::ENCODED_LEN {
22618 panic!(
22619 "buffer is too small (need {} bytes, but got {})",
22620 Self::ENCODED_LEN,
22621 __tmp.remaining(),
22622 )
22623 }
22624 __tmp.put_u64_le(self.time_usec);
22625 __tmp.put_u32_le(self.integration_time_us);
22626 __tmp.put_f32_le(self.integrated_x);
22627 __tmp.put_f32_le(self.integrated_y);
22628 __tmp.put_f32_le(self.integrated_xgyro);
22629 __tmp.put_f32_le(self.integrated_ygyro);
22630 __tmp.put_f32_le(self.integrated_zgyro);
22631 __tmp.put_u32_le(self.time_delta_distance_us);
22632 __tmp.put_f32_le(self.distance);
22633 __tmp.put_i16_le(self.temperature);
22634 __tmp.put_u8(self.sensor_id);
22635 __tmp.put_u8(self.quality);
22636 if matches!(version, MavlinkVersion::V2) {
22637 let len = __tmp.len();
22638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22639 } else {
22640 __tmp.len()
22641 }
22642 }
22643}
22644#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22645#[doc = ""]
22646#[doc = "ID: 360"]
22647#[derive(Debug, Clone, PartialEq)]
22648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22650pub struct ORBIT_EXECUTION_STATUS_DATA {
22651 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22652 pub time_usec: u64,
22653 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22654 pub radius: f32,
22655 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22656 pub x: i32,
22657 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22658 pub y: i32,
22659 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22660 pub z: f32,
22661 #[doc = "The coordinate system of the fields: x, y, z."]
22662 pub frame: MavFrame,
22663}
22664impl ORBIT_EXECUTION_STATUS_DATA {
22665 pub const ENCODED_LEN: usize = 25usize;
22666 pub const DEFAULT: Self = Self {
22667 time_usec: 0_u64,
22668 radius: 0.0_f32,
22669 x: 0_i32,
22670 y: 0_i32,
22671 z: 0.0_f32,
22672 frame: MavFrame::DEFAULT,
22673 };
22674 #[cfg(feature = "arbitrary")]
22675 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22676 use arbitrary::{Arbitrary, Unstructured};
22677 let mut buf = [0u8; 1024];
22678 rng.fill_bytes(&mut buf);
22679 let mut unstructured = Unstructured::new(&buf);
22680 Self::arbitrary(&mut unstructured).unwrap_or_default()
22681 }
22682}
22683impl Default for ORBIT_EXECUTION_STATUS_DATA {
22684 fn default() -> Self {
22685 Self::DEFAULT.clone()
22686 }
22687}
22688impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22689 type Message = MavMessage;
22690 const ID: u32 = 360u32;
22691 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22692 const EXTRA_CRC: u8 = 11u8;
22693 const ENCODED_LEN: usize = 25usize;
22694 fn deser(
22695 _version: MavlinkVersion,
22696 __input: &[u8],
22697 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22698 let avail_len = __input.len();
22699 let mut payload_buf = [0; Self::ENCODED_LEN];
22700 let mut buf = if avail_len < Self::ENCODED_LEN {
22701 payload_buf[0..avail_len].copy_from_slice(__input);
22702 Bytes::new(&payload_buf)
22703 } else {
22704 Bytes::new(__input)
22705 };
22706 let mut __struct = Self::default();
22707 __struct.time_usec = buf.get_u64_le();
22708 __struct.radius = buf.get_f32_le();
22709 __struct.x = buf.get_i32_le();
22710 __struct.y = buf.get_i32_le();
22711 __struct.z = buf.get_f32_le();
22712 let tmp = buf.get_u8();
22713 __struct.frame =
22714 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22715 enum_type: "MavFrame",
22716 value: tmp as u32,
22717 })?;
22718 Ok(__struct)
22719 }
22720 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22721 let mut __tmp = BytesMut::new(bytes);
22722 #[allow(clippy::absurd_extreme_comparisons)]
22723 #[allow(unused_comparisons)]
22724 if __tmp.remaining() < Self::ENCODED_LEN {
22725 panic!(
22726 "buffer is too small (need {} bytes, but got {})",
22727 Self::ENCODED_LEN,
22728 __tmp.remaining(),
22729 )
22730 }
22731 __tmp.put_u64_le(self.time_usec);
22732 __tmp.put_f32_le(self.radius);
22733 __tmp.put_i32_le(self.x);
22734 __tmp.put_i32_le(self.y);
22735 __tmp.put_f32_le(self.z);
22736 __tmp.put_u8(self.frame as u8);
22737 if matches!(version, MavlinkVersion::V2) {
22738 let len = __tmp.len();
22739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22740 } else {
22741 __tmp.len()
22742 }
22743 }
22744}
22745#[doc = "Response from a PARAM_EXT_SET message."]
22746#[doc = ""]
22747#[doc = "ID: 324"]
22748#[derive(Debug, Clone, PartialEq)]
22749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22751pub struct PARAM_EXT_ACK_DATA {
22752 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22753 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22754 pub param_id: [u8; 16],
22755 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22756 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22757 pub param_value: [u8; 128],
22758 #[doc = "Parameter type."]
22759 pub param_type: MavParamExtType,
22760 #[doc = "Result code."]
22761 pub param_result: ParamAck,
22762}
22763impl PARAM_EXT_ACK_DATA {
22764 pub const ENCODED_LEN: usize = 146usize;
22765 pub const DEFAULT: Self = Self {
22766 param_id: [0_u8; 16usize],
22767 param_value: [0_u8; 128usize],
22768 param_type: MavParamExtType::DEFAULT,
22769 param_result: ParamAck::DEFAULT,
22770 };
22771 #[cfg(feature = "arbitrary")]
22772 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22773 use arbitrary::{Arbitrary, Unstructured};
22774 let mut buf = [0u8; 1024];
22775 rng.fill_bytes(&mut buf);
22776 let mut unstructured = Unstructured::new(&buf);
22777 Self::arbitrary(&mut unstructured).unwrap_or_default()
22778 }
22779}
22780impl Default for PARAM_EXT_ACK_DATA {
22781 fn default() -> Self {
22782 Self::DEFAULT.clone()
22783 }
22784}
22785impl MessageData for PARAM_EXT_ACK_DATA {
22786 type Message = MavMessage;
22787 const ID: u32 = 324u32;
22788 const NAME: &'static str = "PARAM_EXT_ACK";
22789 const EXTRA_CRC: u8 = 132u8;
22790 const ENCODED_LEN: usize = 146usize;
22791 fn deser(
22792 _version: MavlinkVersion,
22793 __input: &[u8],
22794 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22795 let avail_len = __input.len();
22796 let mut payload_buf = [0; Self::ENCODED_LEN];
22797 let mut buf = if avail_len < Self::ENCODED_LEN {
22798 payload_buf[0..avail_len].copy_from_slice(__input);
22799 Bytes::new(&payload_buf)
22800 } else {
22801 Bytes::new(__input)
22802 };
22803 let mut __struct = Self::default();
22804 for v in &mut __struct.param_id {
22805 let val = buf.get_u8();
22806 *v = val;
22807 }
22808 for v in &mut __struct.param_value {
22809 let val = buf.get_u8();
22810 *v = val;
22811 }
22812 let tmp = buf.get_u8();
22813 __struct.param_type =
22814 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22815 enum_type: "MavParamExtType",
22816 value: tmp as u32,
22817 })?;
22818 let tmp = buf.get_u8();
22819 __struct.param_result =
22820 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22821 enum_type: "ParamAck",
22822 value: tmp as u32,
22823 })?;
22824 Ok(__struct)
22825 }
22826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22827 let mut __tmp = BytesMut::new(bytes);
22828 #[allow(clippy::absurd_extreme_comparisons)]
22829 #[allow(unused_comparisons)]
22830 if __tmp.remaining() < Self::ENCODED_LEN {
22831 panic!(
22832 "buffer is too small (need {} bytes, but got {})",
22833 Self::ENCODED_LEN,
22834 __tmp.remaining(),
22835 )
22836 }
22837 for val in &self.param_id {
22838 __tmp.put_u8(*val);
22839 }
22840 for val in &self.param_value {
22841 __tmp.put_u8(*val);
22842 }
22843 __tmp.put_u8(self.param_type as u8);
22844 __tmp.put_u8(self.param_result as u8);
22845 if matches!(version, MavlinkVersion::V2) {
22846 let len = __tmp.len();
22847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22848 } else {
22849 __tmp.len()
22850 }
22851 }
22852}
22853#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
22854#[doc = ""]
22855#[doc = "ID: 321"]
22856#[derive(Debug, Clone, PartialEq)]
22857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22859pub struct PARAM_EXT_REQUEST_LIST_DATA {
22860 #[doc = "System ID"]
22861 pub target_system: u8,
22862 #[doc = "Component ID"]
22863 pub target_component: u8,
22864}
22865impl PARAM_EXT_REQUEST_LIST_DATA {
22866 pub const ENCODED_LEN: usize = 2usize;
22867 pub const DEFAULT: Self = Self {
22868 target_system: 0_u8,
22869 target_component: 0_u8,
22870 };
22871 #[cfg(feature = "arbitrary")]
22872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22873 use arbitrary::{Arbitrary, Unstructured};
22874 let mut buf = [0u8; 1024];
22875 rng.fill_bytes(&mut buf);
22876 let mut unstructured = Unstructured::new(&buf);
22877 Self::arbitrary(&mut unstructured).unwrap_or_default()
22878 }
22879}
22880impl Default for PARAM_EXT_REQUEST_LIST_DATA {
22881 fn default() -> Self {
22882 Self::DEFAULT.clone()
22883 }
22884}
22885impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
22886 type Message = MavMessage;
22887 const ID: u32 = 321u32;
22888 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
22889 const EXTRA_CRC: u8 = 88u8;
22890 const ENCODED_LEN: usize = 2usize;
22891 fn deser(
22892 _version: MavlinkVersion,
22893 __input: &[u8],
22894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22895 let avail_len = __input.len();
22896 let mut payload_buf = [0; Self::ENCODED_LEN];
22897 let mut buf = if avail_len < Self::ENCODED_LEN {
22898 payload_buf[0..avail_len].copy_from_slice(__input);
22899 Bytes::new(&payload_buf)
22900 } else {
22901 Bytes::new(__input)
22902 };
22903 let mut __struct = Self::default();
22904 __struct.target_system = buf.get_u8();
22905 __struct.target_component = buf.get_u8();
22906 Ok(__struct)
22907 }
22908 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22909 let mut __tmp = BytesMut::new(bytes);
22910 #[allow(clippy::absurd_extreme_comparisons)]
22911 #[allow(unused_comparisons)]
22912 if __tmp.remaining() < Self::ENCODED_LEN {
22913 panic!(
22914 "buffer is too small (need {} bytes, but got {})",
22915 Self::ENCODED_LEN,
22916 __tmp.remaining(),
22917 )
22918 }
22919 __tmp.put_u8(self.target_system);
22920 __tmp.put_u8(self.target_component);
22921 if matches!(version, MavlinkVersion::V2) {
22922 let len = __tmp.len();
22923 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22924 } else {
22925 __tmp.len()
22926 }
22927 }
22928}
22929#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
22930#[doc = ""]
22931#[doc = "ID: 320"]
22932#[derive(Debug, Clone, PartialEq)]
22933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22935pub struct PARAM_EXT_REQUEST_READ_DATA {
22936 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
22937 pub param_index: i16,
22938 #[doc = "System ID"]
22939 pub target_system: u8,
22940 #[doc = "Component ID"]
22941 pub target_component: u8,
22942 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22943 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22944 pub param_id: [u8; 16],
22945}
22946impl PARAM_EXT_REQUEST_READ_DATA {
22947 pub const ENCODED_LEN: usize = 20usize;
22948 pub const DEFAULT: Self = Self {
22949 param_index: 0_i16,
22950 target_system: 0_u8,
22951 target_component: 0_u8,
22952 param_id: [0_u8; 16usize],
22953 };
22954 #[cfg(feature = "arbitrary")]
22955 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22956 use arbitrary::{Arbitrary, Unstructured};
22957 let mut buf = [0u8; 1024];
22958 rng.fill_bytes(&mut buf);
22959 let mut unstructured = Unstructured::new(&buf);
22960 Self::arbitrary(&mut unstructured).unwrap_or_default()
22961 }
22962}
22963impl Default for PARAM_EXT_REQUEST_READ_DATA {
22964 fn default() -> Self {
22965 Self::DEFAULT.clone()
22966 }
22967}
22968impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
22969 type Message = MavMessage;
22970 const ID: u32 = 320u32;
22971 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
22972 const EXTRA_CRC: u8 = 243u8;
22973 const ENCODED_LEN: usize = 20usize;
22974 fn deser(
22975 _version: MavlinkVersion,
22976 __input: &[u8],
22977 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22978 let avail_len = __input.len();
22979 let mut payload_buf = [0; Self::ENCODED_LEN];
22980 let mut buf = if avail_len < Self::ENCODED_LEN {
22981 payload_buf[0..avail_len].copy_from_slice(__input);
22982 Bytes::new(&payload_buf)
22983 } else {
22984 Bytes::new(__input)
22985 };
22986 let mut __struct = Self::default();
22987 __struct.param_index = buf.get_i16_le();
22988 __struct.target_system = buf.get_u8();
22989 __struct.target_component = buf.get_u8();
22990 for v in &mut __struct.param_id {
22991 let val = buf.get_u8();
22992 *v = val;
22993 }
22994 Ok(__struct)
22995 }
22996 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22997 let mut __tmp = BytesMut::new(bytes);
22998 #[allow(clippy::absurd_extreme_comparisons)]
22999 #[allow(unused_comparisons)]
23000 if __tmp.remaining() < Self::ENCODED_LEN {
23001 panic!(
23002 "buffer is too small (need {} bytes, but got {})",
23003 Self::ENCODED_LEN,
23004 __tmp.remaining(),
23005 )
23006 }
23007 __tmp.put_i16_le(self.param_index);
23008 __tmp.put_u8(self.target_system);
23009 __tmp.put_u8(self.target_component);
23010 for val in &self.param_id {
23011 __tmp.put_u8(*val);
23012 }
23013 if matches!(version, MavlinkVersion::V2) {
23014 let len = __tmp.len();
23015 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23016 } else {
23017 __tmp.len()
23018 }
23019 }
23020}
23021#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23022#[doc = ""]
23023#[doc = "ID: 323"]
23024#[derive(Debug, Clone, PartialEq)]
23025#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23027pub struct PARAM_EXT_SET_DATA {
23028 #[doc = "System ID"]
23029 pub target_system: u8,
23030 #[doc = "Component ID"]
23031 pub target_component: u8,
23032 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23033 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23034 pub param_id: [u8; 16],
23035 #[doc = "Parameter value"]
23036 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23037 pub param_value: [u8; 128],
23038 #[doc = "Parameter type."]
23039 pub param_type: MavParamExtType,
23040}
23041impl PARAM_EXT_SET_DATA {
23042 pub const ENCODED_LEN: usize = 147usize;
23043 pub const DEFAULT: Self = Self {
23044 target_system: 0_u8,
23045 target_component: 0_u8,
23046 param_id: [0_u8; 16usize],
23047 param_value: [0_u8; 128usize],
23048 param_type: MavParamExtType::DEFAULT,
23049 };
23050 #[cfg(feature = "arbitrary")]
23051 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23052 use arbitrary::{Arbitrary, Unstructured};
23053 let mut buf = [0u8; 1024];
23054 rng.fill_bytes(&mut buf);
23055 let mut unstructured = Unstructured::new(&buf);
23056 Self::arbitrary(&mut unstructured).unwrap_or_default()
23057 }
23058}
23059impl Default for PARAM_EXT_SET_DATA {
23060 fn default() -> Self {
23061 Self::DEFAULT.clone()
23062 }
23063}
23064impl MessageData for PARAM_EXT_SET_DATA {
23065 type Message = MavMessage;
23066 const ID: u32 = 323u32;
23067 const NAME: &'static str = "PARAM_EXT_SET";
23068 const EXTRA_CRC: u8 = 78u8;
23069 const ENCODED_LEN: usize = 147usize;
23070 fn deser(
23071 _version: MavlinkVersion,
23072 __input: &[u8],
23073 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23074 let avail_len = __input.len();
23075 let mut payload_buf = [0; Self::ENCODED_LEN];
23076 let mut buf = if avail_len < Self::ENCODED_LEN {
23077 payload_buf[0..avail_len].copy_from_slice(__input);
23078 Bytes::new(&payload_buf)
23079 } else {
23080 Bytes::new(__input)
23081 };
23082 let mut __struct = Self::default();
23083 __struct.target_system = buf.get_u8();
23084 __struct.target_component = buf.get_u8();
23085 for v in &mut __struct.param_id {
23086 let val = buf.get_u8();
23087 *v = val;
23088 }
23089 for v in &mut __struct.param_value {
23090 let val = buf.get_u8();
23091 *v = val;
23092 }
23093 let tmp = buf.get_u8();
23094 __struct.param_type =
23095 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23096 enum_type: "MavParamExtType",
23097 value: tmp as u32,
23098 })?;
23099 Ok(__struct)
23100 }
23101 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23102 let mut __tmp = BytesMut::new(bytes);
23103 #[allow(clippy::absurd_extreme_comparisons)]
23104 #[allow(unused_comparisons)]
23105 if __tmp.remaining() < Self::ENCODED_LEN {
23106 panic!(
23107 "buffer is too small (need {} bytes, but got {})",
23108 Self::ENCODED_LEN,
23109 __tmp.remaining(),
23110 )
23111 }
23112 __tmp.put_u8(self.target_system);
23113 __tmp.put_u8(self.target_component);
23114 for val in &self.param_id {
23115 __tmp.put_u8(*val);
23116 }
23117 for val in &self.param_value {
23118 __tmp.put_u8(*val);
23119 }
23120 __tmp.put_u8(self.param_type as u8);
23121 if matches!(version, MavlinkVersion::V2) {
23122 let len = __tmp.len();
23123 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23124 } else {
23125 __tmp.len()
23126 }
23127 }
23128}
23129#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23130#[doc = ""]
23131#[doc = "ID: 322"]
23132#[derive(Debug, Clone, PartialEq)]
23133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23135pub struct PARAM_EXT_VALUE_DATA {
23136 #[doc = "Total number of parameters"]
23137 pub param_count: u16,
23138 #[doc = "Index of this parameter"]
23139 pub param_index: u16,
23140 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23141 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23142 pub param_id: [u8; 16],
23143 #[doc = "Parameter value"]
23144 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23145 pub param_value: [u8; 128],
23146 #[doc = "Parameter type."]
23147 pub param_type: MavParamExtType,
23148}
23149impl PARAM_EXT_VALUE_DATA {
23150 pub const ENCODED_LEN: usize = 149usize;
23151 pub const DEFAULT: Self = Self {
23152 param_count: 0_u16,
23153 param_index: 0_u16,
23154 param_id: [0_u8; 16usize],
23155 param_value: [0_u8; 128usize],
23156 param_type: MavParamExtType::DEFAULT,
23157 };
23158 #[cfg(feature = "arbitrary")]
23159 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23160 use arbitrary::{Arbitrary, Unstructured};
23161 let mut buf = [0u8; 1024];
23162 rng.fill_bytes(&mut buf);
23163 let mut unstructured = Unstructured::new(&buf);
23164 Self::arbitrary(&mut unstructured).unwrap_or_default()
23165 }
23166}
23167impl Default for PARAM_EXT_VALUE_DATA {
23168 fn default() -> Self {
23169 Self::DEFAULT.clone()
23170 }
23171}
23172impl MessageData for PARAM_EXT_VALUE_DATA {
23173 type Message = MavMessage;
23174 const ID: u32 = 322u32;
23175 const NAME: &'static str = "PARAM_EXT_VALUE";
23176 const EXTRA_CRC: u8 = 243u8;
23177 const ENCODED_LEN: usize = 149usize;
23178 fn deser(
23179 _version: MavlinkVersion,
23180 __input: &[u8],
23181 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23182 let avail_len = __input.len();
23183 let mut payload_buf = [0; Self::ENCODED_LEN];
23184 let mut buf = if avail_len < Self::ENCODED_LEN {
23185 payload_buf[0..avail_len].copy_from_slice(__input);
23186 Bytes::new(&payload_buf)
23187 } else {
23188 Bytes::new(__input)
23189 };
23190 let mut __struct = Self::default();
23191 __struct.param_count = buf.get_u16_le();
23192 __struct.param_index = buf.get_u16_le();
23193 for v in &mut __struct.param_id {
23194 let val = buf.get_u8();
23195 *v = val;
23196 }
23197 for v in &mut __struct.param_value {
23198 let val = buf.get_u8();
23199 *v = val;
23200 }
23201 let tmp = buf.get_u8();
23202 __struct.param_type =
23203 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23204 enum_type: "MavParamExtType",
23205 value: tmp as u32,
23206 })?;
23207 Ok(__struct)
23208 }
23209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23210 let mut __tmp = BytesMut::new(bytes);
23211 #[allow(clippy::absurd_extreme_comparisons)]
23212 #[allow(unused_comparisons)]
23213 if __tmp.remaining() < Self::ENCODED_LEN {
23214 panic!(
23215 "buffer is too small (need {} bytes, but got {})",
23216 Self::ENCODED_LEN,
23217 __tmp.remaining(),
23218 )
23219 }
23220 __tmp.put_u16_le(self.param_count);
23221 __tmp.put_u16_le(self.param_index);
23222 for val in &self.param_id {
23223 __tmp.put_u8(*val);
23224 }
23225 for val in &self.param_value {
23226 __tmp.put_u8(*val);
23227 }
23228 __tmp.put_u8(self.param_type as u8);
23229 if matches!(version, MavlinkVersion::V2) {
23230 let len = __tmp.len();
23231 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23232 } else {
23233 __tmp.len()
23234 }
23235 }
23236}
23237#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23238#[doc = ""]
23239#[doc = "ID: 50"]
23240#[derive(Debug, Clone, PartialEq)]
23241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23243pub struct PARAM_MAP_RC_DATA {
23244 #[doc = "Initial parameter value"]
23245 pub param_value0: f32,
23246 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23247 pub scale: f32,
23248 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23249 pub param_value_min: f32,
23250 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23251 pub param_value_max: f32,
23252 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23253 pub param_index: i16,
23254 #[doc = "System ID"]
23255 pub target_system: u8,
23256 #[doc = "Component ID"]
23257 pub target_component: u8,
23258 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23259 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23260 pub param_id: [u8; 16],
23261 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23262 pub parameter_rc_channel_index: u8,
23263}
23264impl PARAM_MAP_RC_DATA {
23265 pub const ENCODED_LEN: usize = 37usize;
23266 pub const DEFAULT: Self = Self {
23267 param_value0: 0.0_f32,
23268 scale: 0.0_f32,
23269 param_value_min: 0.0_f32,
23270 param_value_max: 0.0_f32,
23271 param_index: 0_i16,
23272 target_system: 0_u8,
23273 target_component: 0_u8,
23274 param_id: [0_u8; 16usize],
23275 parameter_rc_channel_index: 0_u8,
23276 };
23277 #[cfg(feature = "arbitrary")]
23278 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23279 use arbitrary::{Arbitrary, Unstructured};
23280 let mut buf = [0u8; 1024];
23281 rng.fill_bytes(&mut buf);
23282 let mut unstructured = Unstructured::new(&buf);
23283 Self::arbitrary(&mut unstructured).unwrap_or_default()
23284 }
23285}
23286impl Default for PARAM_MAP_RC_DATA {
23287 fn default() -> Self {
23288 Self::DEFAULT.clone()
23289 }
23290}
23291impl MessageData for PARAM_MAP_RC_DATA {
23292 type Message = MavMessage;
23293 const ID: u32 = 50u32;
23294 const NAME: &'static str = "PARAM_MAP_RC";
23295 const EXTRA_CRC: u8 = 78u8;
23296 const ENCODED_LEN: usize = 37usize;
23297 fn deser(
23298 _version: MavlinkVersion,
23299 __input: &[u8],
23300 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23301 let avail_len = __input.len();
23302 let mut payload_buf = [0; Self::ENCODED_LEN];
23303 let mut buf = if avail_len < Self::ENCODED_LEN {
23304 payload_buf[0..avail_len].copy_from_slice(__input);
23305 Bytes::new(&payload_buf)
23306 } else {
23307 Bytes::new(__input)
23308 };
23309 let mut __struct = Self::default();
23310 __struct.param_value0 = buf.get_f32_le();
23311 __struct.scale = buf.get_f32_le();
23312 __struct.param_value_min = buf.get_f32_le();
23313 __struct.param_value_max = buf.get_f32_le();
23314 __struct.param_index = buf.get_i16_le();
23315 __struct.target_system = buf.get_u8();
23316 __struct.target_component = buf.get_u8();
23317 for v in &mut __struct.param_id {
23318 let val = buf.get_u8();
23319 *v = val;
23320 }
23321 __struct.parameter_rc_channel_index = buf.get_u8();
23322 Ok(__struct)
23323 }
23324 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23325 let mut __tmp = BytesMut::new(bytes);
23326 #[allow(clippy::absurd_extreme_comparisons)]
23327 #[allow(unused_comparisons)]
23328 if __tmp.remaining() < Self::ENCODED_LEN {
23329 panic!(
23330 "buffer is too small (need {} bytes, but got {})",
23331 Self::ENCODED_LEN,
23332 __tmp.remaining(),
23333 )
23334 }
23335 __tmp.put_f32_le(self.param_value0);
23336 __tmp.put_f32_le(self.scale);
23337 __tmp.put_f32_le(self.param_value_min);
23338 __tmp.put_f32_le(self.param_value_max);
23339 __tmp.put_i16_le(self.param_index);
23340 __tmp.put_u8(self.target_system);
23341 __tmp.put_u8(self.target_component);
23342 for val in &self.param_id {
23343 __tmp.put_u8(*val);
23344 }
23345 __tmp.put_u8(self.parameter_rc_channel_index);
23346 if matches!(version, MavlinkVersion::V2) {
23347 let len = __tmp.len();
23348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23349 } else {
23350 __tmp.len()
23351 }
23352 }
23353}
23354#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23355#[doc = ""]
23356#[doc = "ID: 21"]
23357#[derive(Debug, Clone, PartialEq)]
23358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23360pub struct PARAM_REQUEST_LIST_DATA {
23361 #[doc = "System ID"]
23362 pub target_system: u8,
23363 #[doc = "Component ID"]
23364 pub target_component: u8,
23365}
23366impl PARAM_REQUEST_LIST_DATA {
23367 pub const ENCODED_LEN: usize = 2usize;
23368 pub const DEFAULT: Self = Self {
23369 target_system: 0_u8,
23370 target_component: 0_u8,
23371 };
23372 #[cfg(feature = "arbitrary")]
23373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23374 use arbitrary::{Arbitrary, Unstructured};
23375 let mut buf = [0u8; 1024];
23376 rng.fill_bytes(&mut buf);
23377 let mut unstructured = Unstructured::new(&buf);
23378 Self::arbitrary(&mut unstructured).unwrap_or_default()
23379 }
23380}
23381impl Default for PARAM_REQUEST_LIST_DATA {
23382 fn default() -> Self {
23383 Self::DEFAULT.clone()
23384 }
23385}
23386impl MessageData for PARAM_REQUEST_LIST_DATA {
23387 type Message = MavMessage;
23388 const ID: u32 = 21u32;
23389 const NAME: &'static str = "PARAM_REQUEST_LIST";
23390 const EXTRA_CRC: u8 = 159u8;
23391 const ENCODED_LEN: usize = 2usize;
23392 fn deser(
23393 _version: MavlinkVersion,
23394 __input: &[u8],
23395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23396 let avail_len = __input.len();
23397 let mut payload_buf = [0; Self::ENCODED_LEN];
23398 let mut buf = if avail_len < Self::ENCODED_LEN {
23399 payload_buf[0..avail_len].copy_from_slice(__input);
23400 Bytes::new(&payload_buf)
23401 } else {
23402 Bytes::new(__input)
23403 };
23404 let mut __struct = Self::default();
23405 __struct.target_system = buf.get_u8();
23406 __struct.target_component = buf.get_u8();
23407 Ok(__struct)
23408 }
23409 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23410 let mut __tmp = BytesMut::new(bytes);
23411 #[allow(clippy::absurd_extreme_comparisons)]
23412 #[allow(unused_comparisons)]
23413 if __tmp.remaining() < Self::ENCODED_LEN {
23414 panic!(
23415 "buffer is too small (need {} bytes, but got {})",
23416 Self::ENCODED_LEN,
23417 __tmp.remaining(),
23418 )
23419 }
23420 __tmp.put_u8(self.target_system);
23421 __tmp.put_u8(self.target_component);
23422 if matches!(version, MavlinkVersion::V2) {
23423 let len = __tmp.len();
23424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23425 } else {
23426 __tmp.len()
23427 }
23428 }
23429}
23430#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23431#[doc = ""]
23432#[doc = "ID: 20"]
23433#[derive(Debug, Clone, PartialEq)]
23434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23436pub struct PARAM_REQUEST_READ_DATA {
23437 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23438 pub param_index: i16,
23439 #[doc = "System ID"]
23440 pub target_system: u8,
23441 #[doc = "Component ID"]
23442 pub target_component: u8,
23443 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23445 pub param_id: [u8; 16],
23446}
23447impl PARAM_REQUEST_READ_DATA {
23448 pub const ENCODED_LEN: usize = 20usize;
23449 pub const DEFAULT: Self = Self {
23450 param_index: 0_i16,
23451 target_system: 0_u8,
23452 target_component: 0_u8,
23453 param_id: [0_u8; 16usize],
23454 };
23455 #[cfg(feature = "arbitrary")]
23456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23457 use arbitrary::{Arbitrary, Unstructured};
23458 let mut buf = [0u8; 1024];
23459 rng.fill_bytes(&mut buf);
23460 let mut unstructured = Unstructured::new(&buf);
23461 Self::arbitrary(&mut unstructured).unwrap_or_default()
23462 }
23463}
23464impl Default for PARAM_REQUEST_READ_DATA {
23465 fn default() -> Self {
23466 Self::DEFAULT.clone()
23467 }
23468}
23469impl MessageData for PARAM_REQUEST_READ_DATA {
23470 type Message = MavMessage;
23471 const ID: u32 = 20u32;
23472 const NAME: &'static str = "PARAM_REQUEST_READ";
23473 const EXTRA_CRC: u8 = 214u8;
23474 const ENCODED_LEN: usize = 20usize;
23475 fn deser(
23476 _version: MavlinkVersion,
23477 __input: &[u8],
23478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23479 let avail_len = __input.len();
23480 let mut payload_buf = [0; Self::ENCODED_LEN];
23481 let mut buf = if avail_len < Self::ENCODED_LEN {
23482 payload_buf[0..avail_len].copy_from_slice(__input);
23483 Bytes::new(&payload_buf)
23484 } else {
23485 Bytes::new(__input)
23486 };
23487 let mut __struct = Self::default();
23488 __struct.param_index = buf.get_i16_le();
23489 __struct.target_system = buf.get_u8();
23490 __struct.target_component = buf.get_u8();
23491 for v in &mut __struct.param_id {
23492 let val = buf.get_u8();
23493 *v = val;
23494 }
23495 Ok(__struct)
23496 }
23497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23498 let mut __tmp = BytesMut::new(bytes);
23499 #[allow(clippy::absurd_extreme_comparisons)]
23500 #[allow(unused_comparisons)]
23501 if __tmp.remaining() < Self::ENCODED_LEN {
23502 panic!(
23503 "buffer is too small (need {} bytes, but got {})",
23504 Self::ENCODED_LEN,
23505 __tmp.remaining(),
23506 )
23507 }
23508 __tmp.put_i16_le(self.param_index);
23509 __tmp.put_u8(self.target_system);
23510 __tmp.put_u8(self.target_component);
23511 for val in &self.param_id {
23512 __tmp.put_u8(*val);
23513 }
23514 if matches!(version, MavlinkVersion::V2) {
23515 let len = __tmp.len();
23516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23517 } else {
23518 __tmp.len()
23519 }
23520 }
23521}
23522#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23523#[doc = ""]
23524#[doc = "ID: 23"]
23525#[derive(Debug, Clone, PartialEq)]
23526#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23527#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23528pub struct PARAM_SET_DATA {
23529 #[doc = "Onboard parameter value"]
23530 pub param_value: f32,
23531 #[doc = "System ID"]
23532 pub target_system: u8,
23533 #[doc = "Component ID"]
23534 pub target_component: u8,
23535 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23536 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23537 pub param_id: [u8; 16],
23538 #[doc = "Onboard parameter type."]
23539 pub param_type: MavParamType,
23540}
23541impl PARAM_SET_DATA {
23542 pub const ENCODED_LEN: usize = 23usize;
23543 pub const DEFAULT: Self = Self {
23544 param_value: 0.0_f32,
23545 target_system: 0_u8,
23546 target_component: 0_u8,
23547 param_id: [0_u8; 16usize],
23548 param_type: MavParamType::DEFAULT,
23549 };
23550 #[cfg(feature = "arbitrary")]
23551 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23552 use arbitrary::{Arbitrary, Unstructured};
23553 let mut buf = [0u8; 1024];
23554 rng.fill_bytes(&mut buf);
23555 let mut unstructured = Unstructured::new(&buf);
23556 Self::arbitrary(&mut unstructured).unwrap_or_default()
23557 }
23558}
23559impl Default for PARAM_SET_DATA {
23560 fn default() -> Self {
23561 Self::DEFAULT.clone()
23562 }
23563}
23564impl MessageData for PARAM_SET_DATA {
23565 type Message = MavMessage;
23566 const ID: u32 = 23u32;
23567 const NAME: &'static str = "PARAM_SET";
23568 const EXTRA_CRC: u8 = 168u8;
23569 const ENCODED_LEN: usize = 23usize;
23570 fn deser(
23571 _version: MavlinkVersion,
23572 __input: &[u8],
23573 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23574 let avail_len = __input.len();
23575 let mut payload_buf = [0; Self::ENCODED_LEN];
23576 let mut buf = if avail_len < Self::ENCODED_LEN {
23577 payload_buf[0..avail_len].copy_from_slice(__input);
23578 Bytes::new(&payload_buf)
23579 } else {
23580 Bytes::new(__input)
23581 };
23582 let mut __struct = Self::default();
23583 __struct.param_value = buf.get_f32_le();
23584 __struct.target_system = buf.get_u8();
23585 __struct.target_component = buf.get_u8();
23586 for v in &mut __struct.param_id {
23587 let val = buf.get_u8();
23588 *v = val;
23589 }
23590 let tmp = buf.get_u8();
23591 __struct.param_type =
23592 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23593 enum_type: "MavParamType",
23594 value: tmp as u32,
23595 })?;
23596 Ok(__struct)
23597 }
23598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23599 let mut __tmp = BytesMut::new(bytes);
23600 #[allow(clippy::absurd_extreme_comparisons)]
23601 #[allow(unused_comparisons)]
23602 if __tmp.remaining() < Self::ENCODED_LEN {
23603 panic!(
23604 "buffer is too small (need {} bytes, but got {})",
23605 Self::ENCODED_LEN,
23606 __tmp.remaining(),
23607 )
23608 }
23609 __tmp.put_f32_le(self.param_value);
23610 __tmp.put_u8(self.target_system);
23611 __tmp.put_u8(self.target_component);
23612 for val in &self.param_id {
23613 __tmp.put_u8(*val);
23614 }
23615 __tmp.put_u8(self.param_type as u8);
23616 if matches!(version, MavlinkVersion::V2) {
23617 let len = __tmp.len();
23618 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23619 } else {
23620 __tmp.len()
23621 }
23622 }
23623}
23624#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23625#[doc = ""]
23626#[doc = "ID: 22"]
23627#[derive(Debug, Clone, PartialEq)]
23628#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23629#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23630pub struct PARAM_VALUE_DATA {
23631 #[doc = "Onboard parameter value"]
23632 pub param_value: f32,
23633 #[doc = "Total number of onboard parameters"]
23634 pub param_count: u16,
23635 #[doc = "Index of this onboard parameter"]
23636 pub param_index: u16,
23637 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23638 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23639 pub param_id: [u8; 16],
23640 #[doc = "Onboard parameter type."]
23641 pub param_type: MavParamType,
23642}
23643impl PARAM_VALUE_DATA {
23644 pub const ENCODED_LEN: usize = 25usize;
23645 pub const DEFAULT: Self = Self {
23646 param_value: 0.0_f32,
23647 param_count: 0_u16,
23648 param_index: 0_u16,
23649 param_id: [0_u8; 16usize],
23650 param_type: MavParamType::DEFAULT,
23651 };
23652 #[cfg(feature = "arbitrary")]
23653 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23654 use arbitrary::{Arbitrary, Unstructured};
23655 let mut buf = [0u8; 1024];
23656 rng.fill_bytes(&mut buf);
23657 let mut unstructured = Unstructured::new(&buf);
23658 Self::arbitrary(&mut unstructured).unwrap_or_default()
23659 }
23660}
23661impl Default for PARAM_VALUE_DATA {
23662 fn default() -> Self {
23663 Self::DEFAULT.clone()
23664 }
23665}
23666impl MessageData for PARAM_VALUE_DATA {
23667 type Message = MavMessage;
23668 const ID: u32 = 22u32;
23669 const NAME: &'static str = "PARAM_VALUE";
23670 const EXTRA_CRC: u8 = 220u8;
23671 const ENCODED_LEN: usize = 25usize;
23672 fn deser(
23673 _version: MavlinkVersion,
23674 __input: &[u8],
23675 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23676 let avail_len = __input.len();
23677 let mut payload_buf = [0; Self::ENCODED_LEN];
23678 let mut buf = if avail_len < Self::ENCODED_LEN {
23679 payload_buf[0..avail_len].copy_from_slice(__input);
23680 Bytes::new(&payload_buf)
23681 } else {
23682 Bytes::new(__input)
23683 };
23684 let mut __struct = Self::default();
23685 __struct.param_value = buf.get_f32_le();
23686 __struct.param_count = buf.get_u16_le();
23687 __struct.param_index = buf.get_u16_le();
23688 for v in &mut __struct.param_id {
23689 let val = buf.get_u8();
23690 *v = val;
23691 }
23692 let tmp = buf.get_u8();
23693 __struct.param_type =
23694 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23695 enum_type: "MavParamType",
23696 value: tmp as u32,
23697 })?;
23698 Ok(__struct)
23699 }
23700 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23701 let mut __tmp = BytesMut::new(bytes);
23702 #[allow(clippy::absurd_extreme_comparisons)]
23703 #[allow(unused_comparisons)]
23704 if __tmp.remaining() < Self::ENCODED_LEN {
23705 panic!(
23706 "buffer is too small (need {} bytes, but got {})",
23707 Self::ENCODED_LEN,
23708 __tmp.remaining(),
23709 )
23710 }
23711 __tmp.put_f32_le(self.param_value);
23712 __tmp.put_u16_le(self.param_count);
23713 __tmp.put_u16_le(self.param_index);
23714 for val in &self.param_id {
23715 __tmp.put_u8(*val);
23716 }
23717 __tmp.put_u8(self.param_type as u8);
23718 if matches!(version, MavlinkVersion::V2) {
23719 let len = __tmp.len();
23720 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23721 } else {
23722 __tmp.len()
23723 }
23724 }
23725}
23726#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
23727#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23728#[doc = ""]
23729#[doc = "ID: 4"]
23730#[derive(Debug, Clone, PartialEq)]
23731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23733pub struct PING_DATA {
23734 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23735 pub time_usec: u64,
23736 #[doc = "PING sequence"]
23737 pub seq: u32,
23738 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23739 pub target_system: u8,
23740 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23741 pub target_component: u8,
23742}
23743impl PING_DATA {
23744 pub const ENCODED_LEN: usize = 14usize;
23745 pub const DEFAULT: Self = Self {
23746 time_usec: 0_u64,
23747 seq: 0_u32,
23748 target_system: 0_u8,
23749 target_component: 0_u8,
23750 };
23751 #[cfg(feature = "arbitrary")]
23752 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23753 use arbitrary::{Arbitrary, Unstructured};
23754 let mut buf = [0u8; 1024];
23755 rng.fill_bytes(&mut buf);
23756 let mut unstructured = Unstructured::new(&buf);
23757 Self::arbitrary(&mut unstructured).unwrap_or_default()
23758 }
23759}
23760impl Default for PING_DATA {
23761 fn default() -> Self {
23762 Self::DEFAULT.clone()
23763 }
23764}
23765impl MessageData for PING_DATA {
23766 type Message = MavMessage;
23767 const ID: u32 = 4u32;
23768 const NAME: &'static str = "PING";
23769 const EXTRA_CRC: u8 = 237u8;
23770 const ENCODED_LEN: usize = 14usize;
23771 fn deser(
23772 _version: MavlinkVersion,
23773 __input: &[u8],
23774 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23775 let avail_len = __input.len();
23776 let mut payload_buf = [0; Self::ENCODED_LEN];
23777 let mut buf = if avail_len < Self::ENCODED_LEN {
23778 payload_buf[0..avail_len].copy_from_slice(__input);
23779 Bytes::new(&payload_buf)
23780 } else {
23781 Bytes::new(__input)
23782 };
23783 let mut __struct = Self::default();
23784 __struct.time_usec = buf.get_u64_le();
23785 __struct.seq = buf.get_u32_le();
23786 __struct.target_system = buf.get_u8();
23787 __struct.target_component = buf.get_u8();
23788 Ok(__struct)
23789 }
23790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23791 let mut __tmp = BytesMut::new(bytes);
23792 #[allow(clippy::absurd_extreme_comparisons)]
23793 #[allow(unused_comparisons)]
23794 if __tmp.remaining() < Self::ENCODED_LEN {
23795 panic!(
23796 "buffer is too small (need {} bytes, but got {})",
23797 Self::ENCODED_LEN,
23798 __tmp.remaining(),
23799 )
23800 }
23801 __tmp.put_u64_le(self.time_usec);
23802 __tmp.put_u32_le(self.seq);
23803 __tmp.put_u8(self.target_system);
23804 __tmp.put_u8(self.target_component);
23805 if matches!(version, MavlinkVersion::V2) {
23806 let len = __tmp.len();
23807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23808 } else {
23809 __tmp.len()
23810 }
23811 }
23812}
23813#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
23814#[doc = "Control vehicle tone generation (buzzer)."]
23815#[doc = ""]
23816#[doc = "ID: 258"]
23817#[derive(Debug, Clone, PartialEq)]
23818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23820pub struct PLAY_TUNE_DATA {
23821 #[doc = "System ID"]
23822 pub target_system: u8,
23823 #[doc = "Component ID"]
23824 pub target_component: u8,
23825 #[doc = "tune in board specific format"]
23826 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23827 pub tune: [u8; 30],
23828 #[doc = "tune extension (appended to tune)"]
23829 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23830 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23831 pub tune2: [u8; 200],
23832}
23833impl PLAY_TUNE_DATA {
23834 pub const ENCODED_LEN: usize = 232usize;
23835 pub const DEFAULT: Self = Self {
23836 target_system: 0_u8,
23837 target_component: 0_u8,
23838 tune: [0_u8; 30usize],
23839 tune2: [0_u8; 200usize],
23840 };
23841 #[cfg(feature = "arbitrary")]
23842 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23843 use arbitrary::{Arbitrary, Unstructured};
23844 let mut buf = [0u8; 1024];
23845 rng.fill_bytes(&mut buf);
23846 let mut unstructured = Unstructured::new(&buf);
23847 Self::arbitrary(&mut unstructured).unwrap_or_default()
23848 }
23849}
23850impl Default for PLAY_TUNE_DATA {
23851 fn default() -> Self {
23852 Self::DEFAULT.clone()
23853 }
23854}
23855impl MessageData for PLAY_TUNE_DATA {
23856 type Message = MavMessage;
23857 const ID: u32 = 258u32;
23858 const NAME: &'static str = "PLAY_TUNE";
23859 const EXTRA_CRC: u8 = 187u8;
23860 const ENCODED_LEN: usize = 232usize;
23861 fn deser(
23862 _version: MavlinkVersion,
23863 __input: &[u8],
23864 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23865 let avail_len = __input.len();
23866 let mut payload_buf = [0; Self::ENCODED_LEN];
23867 let mut buf = if avail_len < Self::ENCODED_LEN {
23868 payload_buf[0..avail_len].copy_from_slice(__input);
23869 Bytes::new(&payload_buf)
23870 } else {
23871 Bytes::new(__input)
23872 };
23873 let mut __struct = Self::default();
23874 __struct.target_system = buf.get_u8();
23875 __struct.target_component = buf.get_u8();
23876 for v in &mut __struct.tune {
23877 let val = buf.get_u8();
23878 *v = val;
23879 }
23880 for v in &mut __struct.tune2 {
23881 let val = buf.get_u8();
23882 *v = val;
23883 }
23884 Ok(__struct)
23885 }
23886 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23887 let mut __tmp = BytesMut::new(bytes);
23888 #[allow(clippy::absurd_extreme_comparisons)]
23889 #[allow(unused_comparisons)]
23890 if __tmp.remaining() < Self::ENCODED_LEN {
23891 panic!(
23892 "buffer is too small (need {} bytes, but got {})",
23893 Self::ENCODED_LEN,
23894 __tmp.remaining(),
23895 )
23896 }
23897 __tmp.put_u8(self.target_system);
23898 __tmp.put_u8(self.target_component);
23899 for val in &self.tune {
23900 __tmp.put_u8(*val);
23901 }
23902 if matches!(version, MavlinkVersion::V2) {
23903 for val in &self.tune2 {
23904 __tmp.put_u8(*val);
23905 }
23906 let len = __tmp.len();
23907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23908 } else {
23909 __tmp.len()
23910 }
23911 }
23912}
23913#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
23914#[doc = ""]
23915#[doc = "ID: 400"]
23916#[derive(Debug, Clone, PartialEq)]
23917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23918#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23919pub struct PLAY_TUNE_V2_DATA {
23920 #[doc = "Tune format"]
23921 pub format: TuneFormat,
23922 #[doc = "System ID"]
23923 pub target_system: u8,
23924 #[doc = "Component ID"]
23925 pub target_component: u8,
23926 #[doc = "Tune definition as a NULL-terminated string."]
23927 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23928 pub tune: [u8; 248],
23929}
23930impl PLAY_TUNE_V2_DATA {
23931 pub const ENCODED_LEN: usize = 254usize;
23932 pub const DEFAULT: Self = Self {
23933 format: TuneFormat::DEFAULT,
23934 target_system: 0_u8,
23935 target_component: 0_u8,
23936 tune: [0_u8; 248usize],
23937 };
23938 #[cfg(feature = "arbitrary")]
23939 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23940 use arbitrary::{Arbitrary, Unstructured};
23941 let mut buf = [0u8; 1024];
23942 rng.fill_bytes(&mut buf);
23943 let mut unstructured = Unstructured::new(&buf);
23944 Self::arbitrary(&mut unstructured).unwrap_or_default()
23945 }
23946}
23947impl Default for PLAY_TUNE_V2_DATA {
23948 fn default() -> Self {
23949 Self::DEFAULT.clone()
23950 }
23951}
23952impl MessageData for PLAY_TUNE_V2_DATA {
23953 type Message = MavMessage;
23954 const ID: u32 = 400u32;
23955 const NAME: &'static str = "PLAY_TUNE_V2";
23956 const EXTRA_CRC: u8 = 110u8;
23957 const ENCODED_LEN: usize = 254usize;
23958 fn deser(
23959 _version: MavlinkVersion,
23960 __input: &[u8],
23961 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23962 let avail_len = __input.len();
23963 let mut payload_buf = [0; Self::ENCODED_LEN];
23964 let mut buf = if avail_len < Self::ENCODED_LEN {
23965 payload_buf[0..avail_len].copy_from_slice(__input);
23966 Bytes::new(&payload_buf)
23967 } else {
23968 Bytes::new(__input)
23969 };
23970 let mut __struct = Self::default();
23971 let tmp = buf.get_u32_le();
23972 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
23973 ::mavlink_core::error::ParserError::InvalidEnum {
23974 enum_type: "TuneFormat",
23975 value: tmp as u32,
23976 },
23977 )?;
23978 __struct.target_system = buf.get_u8();
23979 __struct.target_component = buf.get_u8();
23980 for v in &mut __struct.tune {
23981 let val = buf.get_u8();
23982 *v = val;
23983 }
23984 Ok(__struct)
23985 }
23986 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23987 let mut __tmp = BytesMut::new(bytes);
23988 #[allow(clippy::absurd_extreme_comparisons)]
23989 #[allow(unused_comparisons)]
23990 if __tmp.remaining() < Self::ENCODED_LEN {
23991 panic!(
23992 "buffer is too small (need {} bytes, but got {})",
23993 Self::ENCODED_LEN,
23994 __tmp.remaining(),
23995 )
23996 }
23997 __tmp.put_u32_le(self.format as u32);
23998 __tmp.put_u8(self.target_system);
23999 __tmp.put_u8(self.target_component);
24000 for val in &self.tune {
24001 __tmp.put_u8(*val);
24002 }
24003 if matches!(version, MavlinkVersion::V2) {
24004 let len = __tmp.len();
24005 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24006 } else {
24007 __tmp.len()
24008 }
24009 }
24010}
24011#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24012#[doc = ""]
24013#[doc = "ID: 87"]
24014#[derive(Debug, Clone, PartialEq)]
24015#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24016#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24017pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24018 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24019 pub time_boot_ms: u32,
24020 #[doc = "Latitude in WGS84 frame"]
24021 pub lat_int: i32,
24022 #[doc = "Longitude in WGS84 frame"]
24023 pub lon_int: i32,
24024 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24025 pub alt: f32,
24026 #[doc = "X velocity in NED frame"]
24027 pub vx: f32,
24028 #[doc = "Y velocity in NED frame"]
24029 pub vy: f32,
24030 #[doc = "Z velocity in NED frame"]
24031 pub vz: f32,
24032 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24033 pub afx: f32,
24034 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24035 pub afy: f32,
24036 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24037 pub afz: f32,
24038 #[doc = "yaw setpoint"]
24039 pub yaw: f32,
24040 #[doc = "yaw rate setpoint"]
24041 pub yaw_rate: f32,
24042 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24043 pub type_mask: PositionTargetTypemask,
24044 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24045 pub coordinate_frame: MavFrame,
24046}
24047impl POSITION_TARGET_GLOBAL_INT_DATA {
24048 pub const ENCODED_LEN: usize = 51usize;
24049 pub const DEFAULT: Self = Self {
24050 time_boot_ms: 0_u32,
24051 lat_int: 0_i32,
24052 lon_int: 0_i32,
24053 alt: 0.0_f32,
24054 vx: 0.0_f32,
24055 vy: 0.0_f32,
24056 vz: 0.0_f32,
24057 afx: 0.0_f32,
24058 afy: 0.0_f32,
24059 afz: 0.0_f32,
24060 yaw: 0.0_f32,
24061 yaw_rate: 0.0_f32,
24062 type_mask: PositionTargetTypemask::DEFAULT,
24063 coordinate_frame: MavFrame::DEFAULT,
24064 };
24065 #[cfg(feature = "arbitrary")]
24066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24067 use arbitrary::{Arbitrary, Unstructured};
24068 let mut buf = [0u8; 1024];
24069 rng.fill_bytes(&mut buf);
24070 let mut unstructured = Unstructured::new(&buf);
24071 Self::arbitrary(&mut unstructured).unwrap_or_default()
24072 }
24073}
24074impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24075 fn default() -> Self {
24076 Self::DEFAULT.clone()
24077 }
24078}
24079impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24080 type Message = MavMessage;
24081 const ID: u32 = 87u32;
24082 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24083 const EXTRA_CRC: u8 = 150u8;
24084 const ENCODED_LEN: usize = 51usize;
24085 fn deser(
24086 _version: MavlinkVersion,
24087 __input: &[u8],
24088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24089 let avail_len = __input.len();
24090 let mut payload_buf = [0; Self::ENCODED_LEN];
24091 let mut buf = if avail_len < Self::ENCODED_LEN {
24092 payload_buf[0..avail_len].copy_from_slice(__input);
24093 Bytes::new(&payload_buf)
24094 } else {
24095 Bytes::new(__input)
24096 };
24097 let mut __struct = Self::default();
24098 __struct.time_boot_ms = buf.get_u32_le();
24099 __struct.lat_int = buf.get_i32_le();
24100 __struct.lon_int = buf.get_i32_le();
24101 __struct.alt = buf.get_f32_le();
24102 __struct.vx = buf.get_f32_le();
24103 __struct.vy = buf.get_f32_le();
24104 __struct.vz = buf.get_f32_le();
24105 __struct.afx = buf.get_f32_le();
24106 __struct.afy = buf.get_f32_le();
24107 __struct.afz = buf.get_f32_le();
24108 __struct.yaw = buf.get_f32_le();
24109 __struct.yaw_rate = buf.get_f32_le();
24110 let tmp = buf.get_u16_le();
24111 __struct.type_mask = PositionTargetTypemask::from_bits(
24112 tmp & PositionTargetTypemask::all().bits(),
24113 )
24114 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24115 flag_type: "PositionTargetTypemask",
24116 value: tmp as u32,
24117 })?;
24118 let tmp = buf.get_u8();
24119 __struct.coordinate_frame =
24120 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24121 enum_type: "MavFrame",
24122 value: tmp as u32,
24123 })?;
24124 Ok(__struct)
24125 }
24126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24127 let mut __tmp = BytesMut::new(bytes);
24128 #[allow(clippy::absurd_extreme_comparisons)]
24129 #[allow(unused_comparisons)]
24130 if __tmp.remaining() < Self::ENCODED_LEN {
24131 panic!(
24132 "buffer is too small (need {} bytes, but got {})",
24133 Self::ENCODED_LEN,
24134 __tmp.remaining(),
24135 )
24136 }
24137 __tmp.put_u32_le(self.time_boot_ms);
24138 __tmp.put_i32_le(self.lat_int);
24139 __tmp.put_i32_le(self.lon_int);
24140 __tmp.put_f32_le(self.alt);
24141 __tmp.put_f32_le(self.vx);
24142 __tmp.put_f32_le(self.vy);
24143 __tmp.put_f32_le(self.vz);
24144 __tmp.put_f32_le(self.afx);
24145 __tmp.put_f32_le(self.afy);
24146 __tmp.put_f32_le(self.afz);
24147 __tmp.put_f32_le(self.yaw);
24148 __tmp.put_f32_le(self.yaw_rate);
24149 __tmp.put_u16_le(self.type_mask.bits());
24150 __tmp.put_u8(self.coordinate_frame as u8);
24151 if matches!(version, MavlinkVersion::V2) {
24152 let len = __tmp.len();
24153 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24154 } else {
24155 __tmp.len()
24156 }
24157 }
24158}
24159#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24160#[doc = ""]
24161#[doc = "ID: 85"]
24162#[derive(Debug, Clone, PartialEq)]
24163#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24165pub struct POSITION_TARGET_LOCAL_NED_DATA {
24166 #[doc = "Timestamp (time since system boot)."]
24167 pub time_boot_ms: u32,
24168 #[doc = "X Position in NED frame"]
24169 pub x: f32,
24170 #[doc = "Y Position in NED frame"]
24171 pub y: f32,
24172 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24173 pub z: f32,
24174 #[doc = "X velocity in NED frame"]
24175 pub vx: f32,
24176 #[doc = "Y velocity in NED frame"]
24177 pub vy: f32,
24178 #[doc = "Z velocity in NED frame"]
24179 pub vz: f32,
24180 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24181 pub afx: f32,
24182 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24183 pub afy: f32,
24184 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24185 pub afz: f32,
24186 #[doc = "yaw setpoint"]
24187 pub yaw: f32,
24188 #[doc = "yaw rate setpoint"]
24189 pub yaw_rate: f32,
24190 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24191 pub type_mask: PositionTargetTypemask,
24192 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24193 pub coordinate_frame: MavFrame,
24194}
24195impl POSITION_TARGET_LOCAL_NED_DATA {
24196 pub const ENCODED_LEN: usize = 51usize;
24197 pub const DEFAULT: Self = Self {
24198 time_boot_ms: 0_u32,
24199 x: 0.0_f32,
24200 y: 0.0_f32,
24201 z: 0.0_f32,
24202 vx: 0.0_f32,
24203 vy: 0.0_f32,
24204 vz: 0.0_f32,
24205 afx: 0.0_f32,
24206 afy: 0.0_f32,
24207 afz: 0.0_f32,
24208 yaw: 0.0_f32,
24209 yaw_rate: 0.0_f32,
24210 type_mask: PositionTargetTypemask::DEFAULT,
24211 coordinate_frame: MavFrame::DEFAULT,
24212 };
24213 #[cfg(feature = "arbitrary")]
24214 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24215 use arbitrary::{Arbitrary, Unstructured};
24216 let mut buf = [0u8; 1024];
24217 rng.fill_bytes(&mut buf);
24218 let mut unstructured = Unstructured::new(&buf);
24219 Self::arbitrary(&mut unstructured).unwrap_or_default()
24220 }
24221}
24222impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24223 fn default() -> Self {
24224 Self::DEFAULT.clone()
24225 }
24226}
24227impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24228 type Message = MavMessage;
24229 const ID: u32 = 85u32;
24230 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24231 const EXTRA_CRC: u8 = 140u8;
24232 const ENCODED_LEN: usize = 51usize;
24233 fn deser(
24234 _version: MavlinkVersion,
24235 __input: &[u8],
24236 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24237 let avail_len = __input.len();
24238 let mut payload_buf = [0; Self::ENCODED_LEN];
24239 let mut buf = if avail_len < Self::ENCODED_LEN {
24240 payload_buf[0..avail_len].copy_from_slice(__input);
24241 Bytes::new(&payload_buf)
24242 } else {
24243 Bytes::new(__input)
24244 };
24245 let mut __struct = Self::default();
24246 __struct.time_boot_ms = buf.get_u32_le();
24247 __struct.x = buf.get_f32_le();
24248 __struct.y = buf.get_f32_le();
24249 __struct.z = buf.get_f32_le();
24250 __struct.vx = buf.get_f32_le();
24251 __struct.vy = buf.get_f32_le();
24252 __struct.vz = buf.get_f32_le();
24253 __struct.afx = buf.get_f32_le();
24254 __struct.afy = buf.get_f32_le();
24255 __struct.afz = buf.get_f32_le();
24256 __struct.yaw = buf.get_f32_le();
24257 __struct.yaw_rate = buf.get_f32_le();
24258 let tmp = buf.get_u16_le();
24259 __struct.type_mask = PositionTargetTypemask::from_bits(
24260 tmp & PositionTargetTypemask::all().bits(),
24261 )
24262 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24263 flag_type: "PositionTargetTypemask",
24264 value: tmp as u32,
24265 })?;
24266 let tmp = buf.get_u8();
24267 __struct.coordinate_frame =
24268 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24269 enum_type: "MavFrame",
24270 value: tmp as u32,
24271 })?;
24272 Ok(__struct)
24273 }
24274 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24275 let mut __tmp = BytesMut::new(bytes);
24276 #[allow(clippy::absurd_extreme_comparisons)]
24277 #[allow(unused_comparisons)]
24278 if __tmp.remaining() < Self::ENCODED_LEN {
24279 panic!(
24280 "buffer is too small (need {} bytes, but got {})",
24281 Self::ENCODED_LEN,
24282 __tmp.remaining(),
24283 )
24284 }
24285 __tmp.put_u32_le(self.time_boot_ms);
24286 __tmp.put_f32_le(self.x);
24287 __tmp.put_f32_le(self.y);
24288 __tmp.put_f32_le(self.z);
24289 __tmp.put_f32_le(self.vx);
24290 __tmp.put_f32_le(self.vy);
24291 __tmp.put_f32_le(self.vz);
24292 __tmp.put_f32_le(self.afx);
24293 __tmp.put_f32_le(self.afy);
24294 __tmp.put_f32_le(self.afz);
24295 __tmp.put_f32_le(self.yaw);
24296 __tmp.put_f32_le(self.yaw_rate);
24297 __tmp.put_u16_le(self.type_mask.bits());
24298 __tmp.put_u8(self.coordinate_frame as u8);
24299 if matches!(version, MavlinkVersion::V2) {
24300 let len = __tmp.len();
24301 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24302 } else {
24303 __tmp.len()
24304 }
24305 }
24306}
24307#[doc = "Power supply status."]
24308#[doc = ""]
24309#[doc = "ID: 125"]
24310#[derive(Debug, Clone, PartialEq)]
24311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24312#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24313pub struct POWER_STATUS_DATA {
24314 #[doc = "5V rail voltage."]
24315 pub Vcc: u16,
24316 #[doc = "Servo rail voltage."]
24317 pub Vservo: u16,
24318 #[doc = "Bitmap of power supply status flags."]
24319 pub flags: MavPowerStatus,
24320}
24321impl POWER_STATUS_DATA {
24322 pub const ENCODED_LEN: usize = 6usize;
24323 pub const DEFAULT: Self = Self {
24324 Vcc: 0_u16,
24325 Vservo: 0_u16,
24326 flags: MavPowerStatus::DEFAULT,
24327 };
24328 #[cfg(feature = "arbitrary")]
24329 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24330 use arbitrary::{Arbitrary, Unstructured};
24331 let mut buf = [0u8; 1024];
24332 rng.fill_bytes(&mut buf);
24333 let mut unstructured = Unstructured::new(&buf);
24334 Self::arbitrary(&mut unstructured).unwrap_or_default()
24335 }
24336}
24337impl Default for POWER_STATUS_DATA {
24338 fn default() -> Self {
24339 Self::DEFAULT.clone()
24340 }
24341}
24342impl MessageData for POWER_STATUS_DATA {
24343 type Message = MavMessage;
24344 const ID: u32 = 125u32;
24345 const NAME: &'static str = "POWER_STATUS";
24346 const EXTRA_CRC: u8 = 203u8;
24347 const ENCODED_LEN: usize = 6usize;
24348 fn deser(
24349 _version: MavlinkVersion,
24350 __input: &[u8],
24351 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24352 let avail_len = __input.len();
24353 let mut payload_buf = [0; Self::ENCODED_LEN];
24354 let mut buf = if avail_len < Self::ENCODED_LEN {
24355 payload_buf[0..avail_len].copy_from_slice(__input);
24356 Bytes::new(&payload_buf)
24357 } else {
24358 Bytes::new(__input)
24359 };
24360 let mut __struct = Self::default();
24361 __struct.Vcc = buf.get_u16_le();
24362 __struct.Vservo = buf.get_u16_le();
24363 let tmp = buf.get_u16_le();
24364 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
24365 ::mavlink_core::error::ParserError::InvalidFlag {
24366 flag_type: "MavPowerStatus",
24367 value: tmp as u32,
24368 },
24369 )?;
24370 Ok(__struct)
24371 }
24372 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24373 let mut __tmp = BytesMut::new(bytes);
24374 #[allow(clippy::absurd_extreme_comparisons)]
24375 #[allow(unused_comparisons)]
24376 if __tmp.remaining() < Self::ENCODED_LEN {
24377 panic!(
24378 "buffer is too small (need {} bytes, but got {})",
24379 Self::ENCODED_LEN,
24380 __tmp.remaining(),
24381 )
24382 }
24383 __tmp.put_u16_le(self.Vcc);
24384 __tmp.put_u16_le(self.Vservo);
24385 __tmp.put_u16_le(self.flags.bits());
24386 if matches!(version, MavlinkVersion::V2) {
24387 let len = __tmp.len();
24388 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24389 } else {
24390 __tmp.len()
24391 }
24392 }
24393}
24394#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24395#[doc = ""]
24396#[doc = "ID: 300"]
24397#[derive(Debug, Clone, PartialEq)]
24398#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24400pub struct PROTOCOL_VERSION_DATA {
24401 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24402 pub version: u16,
24403 #[doc = "Minimum MAVLink version supported"]
24404 pub min_version: u16,
24405 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24406 pub max_version: u16,
24407 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24408 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24409 pub spec_version_hash: [u8; 8],
24410 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24411 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24412 pub library_version_hash: [u8; 8],
24413}
24414impl PROTOCOL_VERSION_DATA {
24415 pub const ENCODED_LEN: usize = 22usize;
24416 pub const DEFAULT: Self = Self {
24417 version: 0_u16,
24418 min_version: 0_u16,
24419 max_version: 0_u16,
24420 spec_version_hash: [0_u8; 8usize],
24421 library_version_hash: [0_u8; 8usize],
24422 };
24423 #[cfg(feature = "arbitrary")]
24424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24425 use arbitrary::{Arbitrary, Unstructured};
24426 let mut buf = [0u8; 1024];
24427 rng.fill_bytes(&mut buf);
24428 let mut unstructured = Unstructured::new(&buf);
24429 Self::arbitrary(&mut unstructured).unwrap_or_default()
24430 }
24431}
24432impl Default for PROTOCOL_VERSION_DATA {
24433 fn default() -> Self {
24434 Self::DEFAULT.clone()
24435 }
24436}
24437impl MessageData for PROTOCOL_VERSION_DATA {
24438 type Message = MavMessage;
24439 const ID: u32 = 300u32;
24440 const NAME: &'static str = "PROTOCOL_VERSION";
24441 const EXTRA_CRC: u8 = 217u8;
24442 const ENCODED_LEN: usize = 22usize;
24443 fn deser(
24444 _version: MavlinkVersion,
24445 __input: &[u8],
24446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24447 let avail_len = __input.len();
24448 let mut payload_buf = [0; Self::ENCODED_LEN];
24449 let mut buf = if avail_len < Self::ENCODED_LEN {
24450 payload_buf[0..avail_len].copy_from_slice(__input);
24451 Bytes::new(&payload_buf)
24452 } else {
24453 Bytes::new(__input)
24454 };
24455 let mut __struct = Self::default();
24456 __struct.version = buf.get_u16_le();
24457 __struct.min_version = buf.get_u16_le();
24458 __struct.max_version = buf.get_u16_le();
24459 for v in &mut __struct.spec_version_hash {
24460 let val = buf.get_u8();
24461 *v = val;
24462 }
24463 for v in &mut __struct.library_version_hash {
24464 let val = buf.get_u8();
24465 *v = val;
24466 }
24467 Ok(__struct)
24468 }
24469 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24470 let mut __tmp = BytesMut::new(bytes);
24471 #[allow(clippy::absurd_extreme_comparisons)]
24472 #[allow(unused_comparisons)]
24473 if __tmp.remaining() < Self::ENCODED_LEN {
24474 panic!(
24475 "buffer is too small (need {} bytes, but got {})",
24476 Self::ENCODED_LEN,
24477 __tmp.remaining(),
24478 )
24479 }
24480 __tmp.put_u16_le(self.version);
24481 __tmp.put_u16_le(self.min_version);
24482 __tmp.put_u16_le(self.max_version);
24483 for val in &self.spec_version_hash {
24484 __tmp.put_u8(*val);
24485 }
24486 for val in &self.library_version_hash {
24487 __tmp.put_u8(*val);
24488 }
24489 if matches!(version, MavlinkVersion::V2) {
24490 let len = __tmp.len();
24491 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24492 } else {
24493 __tmp.len()
24494 }
24495 }
24496}
24497#[doc = "Status generated by radio and injected into MAVLink stream."]
24498#[doc = ""]
24499#[doc = "ID: 109"]
24500#[derive(Debug, Clone, PartialEq)]
24501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24503pub struct RADIO_STATUS_DATA {
24504 #[doc = "Count of radio packet receive errors (since boot)."]
24505 pub rxerrors: u16,
24506 #[doc = "Count of error corrected radio packets (since boot)."]
24507 pub fixed: u16,
24508 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24509 pub rssi: u8,
24510 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24511 pub remrssi: u8,
24512 #[doc = "Remaining free transmitter buffer space."]
24513 pub txbuf: u8,
24514 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24515 pub noise: u8,
24516 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24517 pub remnoise: u8,
24518}
24519impl RADIO_STATUS_DATA {
24520 pub const ENCODED_LEN: usize = 9usize;
24521 pub const DEFAULT: Self = Self {
24522 rxerrors: 0_u16,
24523 fixed: 0_u16,
24524 rssi: 0_u8,
24525 remrssi: 0_u8,
24526 txbuf: 0_u8,
24527 noise: 0_u8,
24528 remnoise: 0_u8,
24529 };
24530 #[cfg(feature = "arbitrary")]
24531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24532 use arbitrary::{Arbitrary, Unstructured};
24533 let mut buf = [0u8; 1024];
24534 rng.fill_bytes(&mut buf);
24535 let mut unstructured = Unstructured::new(&buf);
24536 Self::arbitrary(&mut unstructured).unwrap_or_default()
24537 }
24538}
24539impl Default for RADIO_STATUS_DATA {
24540 fn default() -> Self {
24541 Self::DEFAULT.clone()
24542 }
24543}
24544impl MessageData for RADIO_STATUS_DATA {
24545 type Message = MavMessage;
24546 const ID: u32 = 109u32;
24547 const NAME: &'static str = "RADIO_STATUS";
24548 const EXTRA_CRC: u8 = 185u8;
24549 const ENCODED_LEN: usize = 9usize;
24550 fn deser(
24551 _version: MavlinkVersion,
24552 __input: &[u8],
24553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24554 let avail_len = __input.len();
24555 let mut payload_buf = [0; Self::ENCODED_LEN];
24556 let mut buf = if avail_len < Self::ENCODED_LEN {
24557 payload_buf[0..avail_len].copy_from_slice(__input);
24558 Bytes::new(&payload_buf)
24559 } else {
24560 Bytes::new(__input)
24561 };
24562 let mut __struct = Self::default();
24563 __struct.rxerrors = buf.get_u16_le();
24564 __struct.fixed = buf.get_u16_le();
24565 __struct.rssi = buf.get_u8();
24566 __struct.remrssi = buf.get_u8();
24567 __struct.txbuf = buf.get_u8();
24568 __struct.noise = buf.get_u8();
24569 __struct.remnoise = buf.get_u8();
24570 Ok(__struct)
24571 }
24572 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24573 let mut __tmp = BytesMut::new(bytes);
24574 #[allow(clippy::absurd_extreme_comparisons)]
24575 #[allow(unused_comparisons)]
24576 if __tmp.remaining() < Self::ENCODED_LEN {
24577 panic!(
24578 "buffer is too small (need {} bytes, but got {})",
24579 Self::ENCODED_LEN,
24580 __tmp.remaining(),
24581 )
24582 }
24583 __tmp.put_u16_le(self.rxerrors);
24584 __tmp.put_u16_le(self.fixed);
24585 __tmp.put_u8(self.rssi);
24586 __tmp.put_u8(self.remrssi);
24587 __tmp.put_u8(self.txbuf);
24588 __tmp.put_u8(self.noise);
24589 __tmp.put_u8(self.remnoise);
24590 if matches!(version, MavlinkVersion::V2) {
24591 let len = __tmp.len();
24592 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24593 } else {
24594 __tmp.len()
24595 }
24596 }
24597}
24598#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
24599#[doc = ""]
24600#[doc = "ID: 27"]
24601#[derive(Debug, Clone, PartialEq)]
24602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24604pub struct RAW_IMU_DATA {
24605 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24606 pub time_usec: u64,
24607 #[doc = "X acceleration (raw)"]
24608 pub xacc: i16,
24609 #[doc = "Y acceleration (raw)"]
24610 pub yacc: i16,
24611 #[doc = "Z acceleration (raw)"]
24612 pub zacc: i16,
24613 #[doc = "Angular speed around X axis (raw)"]
24614 pub xgyro: i16,
24615 #[doc = "Angular speed around Y axis (raw)"]
24616 pub ygyro: i16,
24617 #[doc = "Angular speed around Z axis (raw)"]
24618 pub zgyro: i16,
24619 #[doc = "X Magnetic field (raw)"]
24620 pub xmag: i16,
24621 #[doc = "Y Magnetic field (raw)"]
24622 pub ymag: i16,
24623 #[doc = "Z Magnetic field (raw)"]
24624 pub zmag: i16,
24625 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24626 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24627 pub id: u8,
24628 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24629 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24630 pub temperature: i16,
24631}
24632impl RAW_IMU_DATA {
24633 pub const ENCODED_LEN: usize = 29usize;
24634 pub const DEFAULT: Self = Self {
24635 time_usec: 0_u64,
24636 xacc: 0_i16,
24637 yacc: 0_i16,
24638 zacc: 0_i16,
24639 xgyro: 0_i16,
24640 ygyro: 0_i16,
24641 zgyro: 0_i16,
24642 xmag: 0_i16,
24643 ymag: 0_i16,
24644 zmag: 0_i16,
24645 id: 0_u8,
24646 temperature: 0_i16,
24647 };
24648 #[cfg(feature = "arbitrary")]
24649 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24650 use arbitrary::{Arbitrary, Unstructured};
24651 let mut buf = [0u8; 1024];
24652 rng.fill_bytes(&mut buf);
24653 let mut unstructured = Unstructured::new(&buf);
24654 Self::arbitrary(&mut unstructured).unwrap_or_default()
24655 }
24656}
24657impl Default for RAW_IMU_DATA {
24658 fn default() -> Self {
24659 Self::DEFAULT.clone()
24660 }
24661}
24662impl MessageData for RAW_IMU_DATA {
24663 type Message = MavMessage;
24664 const ID: u32 = 27u32;
24665 const NAME: &'static str = "RAW_IMU";
24666 const EXTRA_CRC: u8 = 144u8;
24667 const ENCODED_LEN: usize = 29usize;
24668 fn deser(
24669 _version: MavlinkVersion,
24670 __input: &[u8],
24671 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24672 let avail_len = __input.len();
24673 let mut payload_buf = [0; Self::ENCODED_LEN];
24674 let mut buf = if avail_len < Self::ENCODED_LEN {
24675 payload_buf[0..avail_len].copy_from_slice(__input);
24676 Bytes::new(&payload_buf)
24677 } else {
24678 Bytes::new(__input)
24679 };
24680 let mut __struct = Self::default();
24681 __struct.time_usec = buf.get_u64_le();
24682 __struct.xacc = buf.get_i16_le();
24683 __struct.yacc = buf.get_i16_le();
24684 __struct.zacc = buf.get_i16_le();
24685 __struct.xgyro = buf.get_i16_le();
24686 __struct.ygyro = buf.get_i16_le();
24687 __struct.zgyro = buf.get_i16_le();
24688 __struct.xmag = buf.get_i16_le();
24689 __struct.ymag = buf.get_i16_le();
24690 __struct.zmag = buf.get_i16_le();
24691 __struct.id = buf.get_u8();
24692 __struct.temperature = buf.get_i16_le();
24693 Ok(__struct)
24694 }
24695 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24696 let mut __tmp = BytesMut::new(bytes);
24697 #[allow(clippy::absurd_extreme_comparisons)]
24698 #[allow(unused_comparisons)]
24699 if __tmp.remaining() < Self::ENCODED_LEN {
24700 panic!(
24701 "buffer is too small (need {} bytes, but got {})",
24702 Self::ENCODED_LEN,
24703 __tmp.remaining(),
24704 )
24705 }
24706 __tmp.put_u64_le(self.time_usec);
24707 __tmp.put_i16_le(self.xacc);
24708 __tmp.put_i16_le(self.yacc);
24709 __tmp.put_i16_le(self.zacc);
24710 __tmp.put_i16_le(self.xgyro);
24711 __tmp.put_i16_le(self.ygyro);
24712 __tmp.put_i16_le(self.zgyro);
24713 __tmp.put_i16_le(self.xmag);
24714 __tmp.put_i16_le(self.ymag);
24715 __tmp.put_i16_le(self.zmag);
24716 if matches!(version, MavlinkVersion::V2) {
24717 __tmp.put_u8(self.id);
24718 __tmp.put_i16_le(self.temperature);
24719 let len = __tmp.len();
24720 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24721 } else {
24722 __tmp.len()
24723 }
24724 }
24725}
24726#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24727#[doc = ""]
24728#[doc = "ID: 28"]
24729#[derive(Debug, Clone, PartialEq)]
24730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24732pub struct RAW_PRESSURE_DATA {
24733 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24734 pub time_usec: u64,
24735 #[doc = "Absolute pressure (raw)"]
24736 pub press_abs: i16,
24737 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
24738 pub press_diff1: i16,
24739 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
24740 pub press_diff2: i16,
24741 #[doc = "Raw Temperature measurement (raw)"]
24742 pub temperature: i16,
24743}
24744impl RAW_PRESSURE_DATA {
24745 pub const ENCODED_LEN: usize = 16usize;
24746 pub const DEFAULT: Self = Self {
24747 time_usec: 0_u64,
24748 press_abs: 0_i16,
24749 press_diff1: 0_i16,
24750 press_diff2: 0_i16,
24751 temperature: 0_i16,
24752 };
24753 #[cfg(feature = "arbitrary")]
24754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24755 use arbitrary::{Arbitrary, Unstructured};
24756 let mut buf = [0u8; 1024];
24757 rng.fill_bytes(&mut buf);
24758 let mut unstructured = Unstructured::new(&buf);
24759 Self::arbitrary(&mut unstructured).unwrap_or_default()
24760 }
24761}
24762impl Default for RAW_PRESSURE_DATA {
24763 fn default() -> Self {
24764 Self::DEFAULT.clone()
24765 }
24766}
24767impl MessageData for RAW_PRESSURE_DATA {
24768 type Message = MavMessage;
24769 const ID: u32 = 28u32;
24770 const NAME: &'static str = "RAW_PRESSURE";
24771 const EXTRA_CRC: u8 = 67u8;
24772 const ENCODED_LEN: usize = 16usize;
24773 fn deser(
24774 _version: MavlinkVersion,
24775 __input: &[u8],
24776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24777 let avail_len = __input.len();
24778 let mut payload_buf = [0; Self::ENCODED_LEN];
24779 let mut buf = if avail_len < Self::ENCODED_LEN {
24780 payload_buf[0..avail_len].copy_from_slice(__input);
24781 Bytes::new(&payload_buf)
24782 } else {
24783 Bytes::new(__input)
24784 };
24785 let mut __struct = Self::default();
24786 __struct.time_usec = buf.get_u64_le();
24787 __struct.press_abs = buf.get_i16_le();
24788 __struct.press_diff1 = buf.get_i16_le();
24789 __struct.press_diff2 = buf.get_i16_le();
24790 __struct.temperature = buf.get_i16_le();
24791 Ok(__struct)
24792 }
24793 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24794 let mut __tmp = BytesMut::new(bytes);
24795 #[allow(clippy::absurd_extreme_comparisons)]
24796 #[allow(unused_comparisons)]
24797 if __tmp.remaining() < Self::ENCODED_LEN {
24798 panic!(
24799 "buffer is too small (need {} bytes, but got {})",
24800 Self::ENCODED_LEN,
24801 __tmp.remaining(),
24802 )
24803 }
24804 __tmp.put_u64_le(self.time_usec);
24805 __tmp.put_i16_le(self.press_abs);
24806 __tmp.put_i16_le(self.press_diff1);
24807 __tmp.put_i16_le(self.press_diff2);
24808 __tmp.put_i16_le(self.temperature);
24809 if matches!(version, MavlinkVersion::V2) {
24810 let len = __tmp.len();
24811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24812 } else {
24813 __tmp.len()
24814 }
24815 }
24816}
24817#[doc = "RPM sensor data message."]
24818#[doc = ""]
24819#[doc = "ID: 339"]
24820#[derive(Debug, Clone, PartialEq)]
24821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24823pub struct RAW_RPM_DATA {
24824 #[doc = "Indicated rate"]
24825 pub frequency: f32,
24826 #[doc = "Index of this RPM sensor (0-indexed)"]
24827 pub index: u8,
24828}
24829impl RAW_RPM_DATA {
24830 pub const ENCODED_LEN: usize = 5usize;
24831 pub const DEFAULT: Self = Self {
24832 frequency: 0.0_f32,
24833 index: 0_u8,
24834 };
24835 #[cfg(feature = "arbitrary")]
24836 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24837 use arbitrary::{Arbitrary, Unstructured};
24838 let mut buf = [0u8; 1024];
24839 rng.fill_bytes(&mut buf);
24840 let mut unstructured = Unstructured::new(&buf);
24841 Self::arbitrary(&mut unstructured).unwrap_or_default()
24842 }
24843}
24844impl Default for RAW_RPM_DATA {
24845 fn default() -> Self {
24846 Self::DEFAULT.clone()
24847 }
24848}
24849impl MessageData for RAW_RPM_DATA {
24850 type Message = MavMessage;
24851 const ID: u32 = 339u32;
24852 const NAME: &'static str = "RAW_RPM";
24853 const EXTRA_CRC: u8 = 199u8;
24854 const ENCODED_LEN: usize = 5usize;
24855 fn deser(
24856 _version: MavlinkVersion,
24857 __input: &[u8],
24858 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24859 let avail_len = __input.len();
24860 let mut payload_buf = [0; Self::ENCODED_LEN];
24861 let mut buf = if avail_len < Self::ENCODED_LEN {
24862 payload_buf[0..avail_len].copy_from_slice(__input);
24863 Bytes::new(&payload_buf)
24864 } else {
24865 Bytes::new(__input)
24866 };
24867 let mut __struct = Self::default();
24868 __struct.frequency = buf.get_f32_le();
24869 __struct.index = buf.get_u8();
24870 Ok(__struct)
24871 }
24872 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24873 let mut __tmp = BytesMut::new(bytes);
24874 #[allow(clippy::absurd_extreme_comparisons)]
24875 #[allow(unused_comparisons)]
24876 if __tmp.remaining() < Self::ENCODED_LEN {
24877 panic!(
24878 "buffer is too small (need {} bytes, but got {})",
24879 Self::ENCODED_LEN,
24880 __tmp.remaining(),
24881 )
24882 }
24883 __tmp.put_f32_le(self.frequency);
24884 __tmp.put_u8(self.index);
24885 if matches!(version, MavlinkVersion::V2) {
24886 let len = __tmp.len();
24887 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24888 } else {
24889 __tmp.len()
24890 }
24891 }
24892}
24893#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24894#[doc = ""]
24895#[doc = "ID: 65"]
24896#[derive(Debug, Clone, PartialEq)]
24897#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24898#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24899pub struct RC_CHANNELS_DATA {
24900 #[doc = "Timestamp (time since system boot)."]
24901 pub time_boot_ms: u32,
24902 #[doc = "RC channel 1 value."]
24903 pub chan1_raw: u16,
24904 #[doc = "RC channel 2 value."]
24905 pub chan2_raw: u16,
24906 #[doc = "RC channel 3 value."]
24907 pub chan3_raw: u16,
24908 #[doc = "RC channel 4 value."]
24909 pub chan4_raw: u16,
24910 #[doc = "RC channel 5 value."]
24911 pub chan5_raw: u16,
24912 #[doc = "RC channel 6 value."]
24913 pub chan6_raw: u16,
24914 #[doc = "RC channel 7 value."]
24915 pub chan7_raw: u16,
24916 #[doc = "RC channel 8 value."]
24917 pub chan8_raw: u16,
24918 #[doc = "RC channel 9 value."]
24919 pub chan9_raw: u16,
24920 #[doc = "RC channel 10 value."]
24921 pub chan10_raw: u16,
24922 #[doc = "RC channel 11 value."]
24923 pub chan11_raw: u16,
24924 #[doc = "RC channel 12 value."]
24925 pub chan12_raw: u16,
24926 #[doc = "RC channel 13 value."]
24927 pub chan13_raw: u16,
24928 #[doc = "RC channel 14 value."]
24929 pub chan14_raw: u16,
24930 #[doc = "RC channel 15 value."]
24931 pub chan15_raw: u16,
24932 #[doc = "RC channel 16 value."]
24933 pub chan16_raw: u16,
24934 #[doc = "RC channel 17 value."]
24935 pub chan17_raw: u16,
24936 #[doc = "RC channel 18 value."]
24937 pub chan18_raw: u16,
24938 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
24939 pub chancount: u8,
24940 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24941 pub rssi: u8,
24942}
24943impl RC_CHANNELS_DATA {
24944 pub const ENCODED_LEN: usize = 42usize;
24945 pub const DEFAULT: Self = Self {
24946 time_boot_ms: 0_u32,
24947 chan1_raw: 0_u16,
24948 chan2_raw: 0_u16,
24949 chan3_raw: 0_u16,
24950 chan4_raw: 0_u16,
24951 chan5_raw: 0_u16,
24952 chan6_raw: 0_u16,
24953 chan7_raw: 0_u16,
24954 chan8_raw: 0_u16,
24955 chan9_raw: 0_u16,
24956 chan10_raw: 0_u16,
24957 chan11_raw: 0_u16,
24958 chan12_raw: 0_u16,
24959 chan13_raw: 0_u16,
24960 chan14_raw: 0_u16,
24961 chan15_raw: 0_u16,
24962 chan16_raw: 0_u16,
24963 chan17_raw: 0_u16,
24964 chan18_raw: 0_u16,
24965 chancount: 0_u8,
24966 rssi: 0_u8,
24967 };
24968 #[cfg(feature = "arbitrary")]
24969 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24970 use arbitrary::{Arbitrary, Unstructured};
24971 let mut buf = [0u8; 1024];
24972 rng.fill_bytes(&mut buf);
24973 let mut unstructured = Unstructured::new(&buf);
24974 Self::arbitrary(&mut unstructured).unwrap_or_default()
24975 }
24976}
24977impl Default for RC_CHANNELS_DATA {
24978 fn default() -> Self {
24979 Self::DEFAULT.clone()
24980 }
24981}
24982impl MessageData for RC_CHANNELS_DATA {
24983 type Message = MavMessage;
24984 const ID: u32 = 65u32;
24985 const NAME: &'static str = "RC_CHANNELS";
24986 const EXTRA_CRC: u8 = 118u8;
24987 const ENCODED_LEN: usize = 42usize;
24988 fn deser(
24989 _version: MavlinkVersion,
24990 __input: &[u8],
24991 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24992 let avail_len = __input.len();
24993 let mut payload_buf = [0; Self::ENCODED_LEN];
24994 let mut buf = if avail_len < Self::ENCODED_LEN {
24995 payload_buf[0..avail_len].copy_from_slice(__input);
24996 Bytes::new(&payload_buf)
24997 } else {
24998 Bytes::new(__input)
24999 };
25000 let mut __struct = Self::default();
25001 __struct.time_boot_ms = buf.get_u32_le();
25002 __struct.chan1_raw = buf.get_u16_le();
25003 __struct.chan2_raw = buf.get_u16_le();
25004 __struct.chan3_raw = buf.get_u16_le();
25005 __struct.chan4_raw = buf.get_u16_le();
25006 __struct.chan5_raw = buf.get_u16_le();
25007 __struct.chan6_raw = buf.get_u16_le();
25008 __struct.chan7_raw = buf.get_u16_le();
25009 __struct.chan8_raw = buf.get_u16_le();
25010 __struct.chan9_raw = buf.get_u16_le();
25011 __struct.chan10_raw = buf.get_u16_le();
25012 __struct.chan11_raw = buf.get_u16_le();
25013 __struct.chan12_raw = buf.get_u16_le();
25014 __struct.chan13_raw = buf.get_u16_le();
25015 __struct.chan14_raw = buf.get_u16_le();
25016 __struct.chan15_raw = buf.get_u16_le();
25017 __struct.chan16_raw = buf.get_u16_le();
25018 __struct.chan17_raw = buf.get_u16_le();
25019 __struct.chan18_raw = buf.get_u16_le();
25020 __struct.chancount = buf.get_u8();
25021 __struct.rssi = buf.get_u8();
25022 Ok(__struct)
25023 }
25024 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25025 let mut __tmp = BytesMut::new(bytes);
25026 #[allow(clippy::absurd_extreme_comparisons)]
25027 #[allow(unused_comparisons)]
25028 if __tmp.remaining() < Self::ENCODED_LEN {
25029 panic!(
25030 "buffer is too small (need {} bytes, but got {})",
25031 Self::ENCODED_LEN,
25032 __tmp.remaining(),
25033 )
25034 }
25035 __tmp.put_u32_le(self.time_boot_ms);
25036 __tmp.put_u16_le(self.chan1_raw);
25037 __tmp.put_u16_le(self.chan2_raw);
25038 __tmp.put_u16_le(self.chan3_raw);
25039 __tmp.put_u16_le(self.chan4_raw);
25040 __tmp.put_u16_le(self.chan5_raw);
25041 __tmp.put_u16_le(self.chan6_raw);
25042 __tmp.put_u16_le(self.chan7_raw);
25043 __tmp.put_u16_le(self.chan8_raw);
25044 __tmp.put_u16_le(self.chan9_raw);
25045 __tmp.put_u16_le(self.chan10_raw);
25046 __tmp.put_u16_le(self.chan11_raw);
25047 __tmp.put_u16_le(self.chan12_raw);
25048 __tmp.put_u16_le(self.chan13_raw);
25049 __tmp.put_u16_le(self.chan14_raw);
25050 __tmp.put_u16_le(self.chan15_raw);
25051 __tmp.put_u16_le(self.chan16_raw);
25052 __tmp.put_u16_le(self.chan17_raw);
25053 __tmp.put_u16_le(self.chan18_raw);
25054 __tmp.put_u8(self.chancount);
25055 __tmp.put_u8(self.rssi);
25056 if matches!(version, MavlinkVersion::V2) {
25057 let len = __tmp.len();
25058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25059 } else {
25060 __tmp.len()
25061 }
25062 }
25063}
25064#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25065#[doc = ""]
25066#[doc = "ID: 70"]
25067#[derive(Debug, Clone, PartialEq)]
25068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25070pub struct RC_CHANNELS_OVERRIDE_DATA {
25071 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25072 pub chan1_raw: u16,
25073 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25074 pub chan2_raw: u16,
25075 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25076 pub chan3_raw: u16,
25077 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25078 pub chan4_raw: u16,
25079 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25080 pub chan5_raw: u16,
25081 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25082 pub chan6_raw: u16,
25083 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25084 pub chan7_raw: u16,
25085 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25086 pub chan8_raw: u16,
25087 #[doc = "System ID"]
25088 pub target_system: u8,
25089 #[doc = "Component ID"]
25090 pub target_component: u8,
25091 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25092 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25093 pub chan9_raw: u16,
25094 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25095 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25096 pub chan10_raw: u16,
25097 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25098 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25099 pub chan11_raw: u16,
25100 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25101 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25102 pub chan12_raw: u16,
25103 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25104 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25105 pub chan13_raw: u16,
25106 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25107 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25108 pub chan14_raw: u16,
25109 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25110 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25111 pub chan15_raw: u16,
25112 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25113 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25114 pub chan16_raw: u16,
25115 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25116 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25117 pub chan17_raw: u16,
25118 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25119 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25120 pub chan18_raw: u16,
25121}
25122impl RC_CHANNELS_OVERRIDE_DATA {
25123 pub const ENCODED_LEN: usize = 38usize;
25124 pub const DEFAULT: Self = Self {
25125 chan1_raw: 0_u16,
25126 chan2_raw: 0_u16,
25127 chan3_raw: 0_u16,
25128 chan4_raw: 0_u16,
25129 chan5_raw: 0_u16,
25130 chan6_raw: 0_u16,
25131 chan7_raw: 0_u16,
25132 chan8_raw: 0_u16,
25133 target_system: 0_u8,
25134 target_component: 0_u8,
25135 chan9_raw: 0_u16,
25136 chan10_raw: 0_u16,
25137 chan11_raw: 0_u16,
25138 chan12_raw: 0_u16,
25139 chan13_raw: 0_u16,
25140 chan14_raw: 0_u16,
25141 chan15_raw: 0_u16,
25142 chan16_raw: 0_u16,
25143 chan17_raw: 0_u16,
25144 chan18_raw: 0_u16,
25145 };
25146 #[cfg(feature = "arbitrary")]
25147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25148 use arbitrary::{Arbitrary, Unstructured};
25149 let mut buf = [0u8; 1024];
25150 rng.fill_bytes(&mut buf);
25151 let mut unstructured = Unstructured::new(&buf);
25152 Self::arbitrary(&mut unstructured).unwrap_or_default()
25153 }
25154}
25155impl Default for RC_CHANNELS_OVERRIDE_DATA {
25156 fn default() -> Self {
25157 Self::DEFAULT.clone()
25158 }
25159}
25160impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25161 type Message = MavMessage;
25162 const ID: u32 = 70u32;
25163 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25164 const EXTRA_CRC: u8 = 124u8;
25165 const ENCODED_LEN: usize = 38usize;
25166 fn deser(
25167 _version: MavlinkVersion,
25168 __input: &[u8],
25169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25170 let avail_len = __input.len();
25171 let mut payload_buf = [0; Self::ENCODED_LEN];
25172 let mut buf = if avail_len < Self::ENCODED_LEN {
25173 payload_buf[0..avail_len].copy_from_slice(__input);
25174 Bytes::new(&payload_buf)
25175 } else {
25176 Bytes::new(__input)
25177 };
25178 let mut __struct = Self::default();
25179 __struct.chan1_raw = buf.get_u16_le();
25180 __struct.chan2_raw = buf.get_u16_le();
25181 __struct.chan3_raw = buf.get_u16_le();
25182 __struct.chan4_raw = buf.get_u16_le();
25183 __struct.chan5_raw = buf.get_u16_le();
25184 __struct.chan6_raw = buf.get_u16_le();
25185 __struct.chan7_raw = buf.get_u16_le();
25186 __struct.chan8_raw = buf.get_u16_le();
25187 __struct.target_system = buf.get_u8();
25188 __struct.target_component = buf.get_u8();
25189 __struct.chan9_raw = buf.get_u16_le();
25190 __struct.chan10_raw = buf.get_u16_le();
25191 __struct.chan11_raw = buf.get_u16_le();
25192 __struct.chan12_raw = buf.get_u16_le();
25193 __struct.chan13_raw = buf.get_u16_le();
25194 __struct.chan14_raw = buf.get_u16_le();
25195 __struct.chan15_raw = buf.get_u16_le();
25196 __struct.chan16_raw = buf.get_u16_le();
25197 __struct.chan17_raw = buf.get_u16_le();
25198 __struct.chan18_raw = buf.get_u16_le();
25199 Ok(__struct)
25200 }
25201 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25202 let mut __tmp = BytesMut::new(bytes);
25203 #[allow(clippy::absurd_extreme_comparisons)]
25204 #[allow(unused_comparisons)]
25205 if __tmp.remaining() < Self::ENCODED_LEN {
25206 panic!(
25207 "buffer is too small (need {} bytes, but got {})",
25208 Self::ENCODED_LEN,
25209 __tmp.remaining(),
25210 )
25211 }
25212 __tmp.put_u16_le(self.chan1_raw);
25213 __tmp.put_u16_le(self.chan2_raw);
25214 __tmp.put_u16_le(self.chan3_raw);
25215 __tmp.put_u16_le(self.chan4_raw);
25216 __tmp.put_u16_le(self.chan5_raw);
25217 __tmp.put_u16_le(self.chan6_raw);
25218 __tmp.put_u16_le(self.chan7_raw);
25219 __tmp.put_u16_le(self.chan8_raw);
25220 __tmp.put_u8(self.target_system);
25221 __tmp.put_u8(self.target_component);
25222 if matches!(version, MavlinkVersion::V2) {
25223 __tmp.put_u16_le(self.chan9_raw);
25224 __tmp.put_u16_le(self.chan10_raw);
25225 __tmp.put_u16_le(self.chan11_raw);
25226 __tmp.put_u16_le(self.chan12_raw);
25227 __tmp.put_u16_le(self.chan13_raw);
25228 __tmp.put_u16_le(self.chan14_raw);
25229 __tmp.put_u16_le(self.chan15_raw);
25230 __tmp.put_u16_le(self.chan16_raw);
25231 __tmp.put_u16_le(self.chan17_raw);
25232 __tmp.put_u16_le(self.chan18_raw);
25233 let len = __tmp.len();
25234 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25235 } else {
25236 __tmp.len()
25237 }
25238 }
25239}
25240#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25241#[doc = ""]
25242#[doc = "ID: 35"]
25243#[derive(Debug, Clone, PartialEq)]
25244#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25246pub struct RC_CHANNELS_RAW_DATA {
25247 #[doc = "Timestamp (time since system boot)."]
25248 pub time_boot_ms: u32,
25249 #[doc = "RC channel 1 value."]
25250 pub chan1_raw: u16,
25251 #[doc = "RC channel 2 value."]
25252 pub chan2_raw: u16,
25253 #[doc = "RC channel 3 value."]
25254 pub chan3_raw: u16,
25255 #[doc = "RC channel 4 value."]
25256 pub chan4_raw: u16,
25257 #[doc = "RC channel 5 value."]
25258 pub chan5_raw: u16,
25259 #[doc = "RC channel 6 value."]
25260 pub chan6_raw: u16,
25261 #[doc = "RC channel 7 value."]
25262 pub chan7_raw: u16,
25263 #[doc = "RC channel 8 value."]
25264 pub chan8_raw: u16,
25265 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25266 pub port: u8,
25267 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25268 pub rssi: u8,
25269}
25270impl RC_CHANNELS_RAW_DATA {
25271 pub const ENCODED_LEN: usize = 22usize;
25272 pub const DEFAULT: Self = Self {
25273 time_boot_ms: 0_u32,
25274 chan1_raw: 0_u16,
25275 chan2_raw: 0_u16,
25276 chan3_raw: 0_u16,
25277 chan4_raw: 0_u16,
25278 chan5_raw: 0_u16,
25279 chan6_raw: 0_u16,
25280 chan7_raw: 0_u16,
25281 chan8_raw: 0_u16,
25282 port: 0_u8,
25283 rssi: 0_u8,
25284 };
25285 #[cfg(feature = "arbitrary")]
25286 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25287 use arbitrary::{Arbitrary, Unstructured};
25288 let mut buf = [0u8; 1024];
25289 rng.fill_bytes(&mut buf);
25290 let mut unstructured = Unstructured::new(&buf);
25291 Self::arbitrary(&mut unstructured).unwrap_or_default()
25292 }
25293}
25294impl Default for RC_CHANNELS_RAW_DATA {
25295 fn default() -> Self {
25296 Self::DEFAULT.clone()
25297 }
25298}
25299impl MessageData for RC_CHANNELS_RAW_DATA {
25300 type Message = MavMessage;
25301 const ID: u32 = 35u32;
25302 const NAME: &'static str = "RC_CHANNELS_RAW";
25303 const EXTRA_CRC: u8 = 244u8;
25304 const ENCODED_LEN: usize = 22usize;
25305 fn deser(
25306 _version: MavlinkVersion,
25307 __input: &[u8],
25308 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25309 let avail_len = __input.len();
25310 let mut payload_buf = [0; Self::ENCODED_LEN];
25311 let mut buf = if avail_len < Self::ENCODED_LEN {
25312 payload_buf[0..avail_len].copy_from_slice(__input);
25313 Bytes::new(&payload_buf)
25314 } else {
25315 Bytes::new(__input)
25316 };
25317 let mut __struct = Self::default();
25318 __struct.time_boot_ms = buf.get_u32_le();
25319 __struct.chan1_raw = buf.get_u16_le();
25320 __struct.chan2_raw = buf.get_u16_le();
25321 __struct.chan3_raw = buf.get_u16_le();
25322 __struct.chan4_raw = buf.get_u16_le();
25323 __struct.chan5_raw = buf.get_u16_le();
25324 __struct.chan6_raw = buf.get_u16_le();
25325 __struct.chan7_raw = buf.get_u16_le();
25326 __struct.chan8_raw = buf.get_u16_le();
25327 __struct.port = buf.get_u8();
25328 __struct.rssi = buf.get_u8();
25329 Ok(__struct)
25330 }
25331 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25332 let mut __tmp = BytesMut::new(bytes);
25333 #[allow(clippy::absurd_extreme_comparisons)]
25334 #[allow(unused_comparisons)]
25335 if __tmp.remaining() < Self::ENCODED_LEN {
25336 panic!(
25337 "buffer is too small (need {} bytes, but got {})",
25338 Self::ENCODED_LEN,
25339 __tmp.remaining(),
25340 )
25341 }
25342 __tmp.put_u32_le(self.time_boot_ms);
25343 __tmp.put_u16_le(self.chan1_raw);
25344 __tmp.put_u16_le(self.chan2_raw);
25345 __tmp.put_u16_le(self.chan3_raw);
25346 __tmp.put_u16_le(self.chan4_raw);
25347 __tmp.put_u16_le(self.chan5_raw);
25348 __tmp.put_u16_le(self.chan6_raw);
25349 __tmp.put_u16_le(self.chan7_raw);
25350 __tmp.put_u16_le(self.chan8_raw);
25351 __tmp.put_u8(self.port);
25352 __tmp.put_u8(self.rssi);
25353 if matches!(version, MavlinkVersion::V2) {
25354 let len = __tmp.len();
25355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25356 } else {
25357 __tmp.len()
25358 }
25359 }
25360}
25361#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25362#[doc = ""]
25363#[doc = "ID: 34"]
25364#[derive(Debug, Clone, PartialEq)]
25365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25367pub struct RC_CHANNELS_SCALED_DATA {
25368 #[doc = "Timestamp (time since system boot)."]
25369 pub time_boot_ms: u32,
25370 #[doc = "RC channel 1 value scaled."]
25371 pub chan1_scaled: i16,
25372 #[doc = "RC channel 2 value scaled."]
25373 pub chan2_scaled: i16,
25374 #[doc = "RC channel 3 value scaled."]
25375 pub chan3_scaled: i16,
25376 #[doc = "RC channel 4 value scaled."]
25377 pub chan4_scaled: i16,
25378 #[doc = "RC channel 5 value scaled."]
25379 pub chan5_scaled: i16,
25380 #[doc = "RC channel 6 value scaled."]
25381 pub chan6_scaled: i16,
25382 #[doc = "RC channel 7 value scaled."]
25383 pub chan7_scaled: i16,
25384 #[doc = "RC channel 8 value scaled."]
25385 pub chan8_scaled: i16,
25386 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25387 pub port: u8,
25388 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25389 pub rssi: u8,
25390}
25391impl RC_CHANNELS_SCALED_DATA {
25392 pub const ENCODED_LEN: usize = 22usize;
25393 pub const DEFAULT: Self = Self {
25394 time_boot_ms: 0_u32,
25395 chan1_scaled: 0_i16,
25396 chan2_scaled: 0_i16,
25397 chan3_scaled: 0_i16,
25398 chan4_scaled: 0_i16,
25399 chan5_scaled: 0_i16,
25400 chan6_scaled: 0_i16,
25401 chan7_scaled: 0_i16,
25402 chan8_scaled: 0_i16,
25403 port: 0_u8,
25404 rssi: 0_u8,
25405 };
25406 #[cfg(feature = "arbitrary")]
25407 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25408 use arbitrary::{Arbitrary, Unstructured};
25409 let mut buf = [0u8; 1024];
25410 rng.fill_bytes(&mut buf);
25411 let mut unstructured = Unstructured::new(&buf);
25412 Self::arbitrary(&mut unstructured).unwrap_or_default()
25413 }
25414}
25415impl Default for RC_CHANNELS_SCALED_DATA {
25416 fn default() -> Self {
25417 Self::DEFAULT.clone()
25418 }
25419}
25420impl MessageData for RC_CHANNELS_SCALED_DATA {
25421 type Message = MavMessage;
25422 const ID: u32 = 34u32;
25423 const NAME: &'static str = "RC_CHANNELS_SCALED";
25424 const EXTRA_CRC: u8 = 237u8;
25425 const ENCODED_LEN: usize = 22usize;
25426 fn deser(
25427 _version: MavlinkVersion,
25428 __input: &[u8],
25429 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25430 let avail_len = __input.len();
25431 let mut payload_buf = [0; Self::ENCODED_LEN];
25432 let mut buf = if avail_len < Self::ENCODED_LEN {
25433 payload_buf[0..avail_len].copy_from_slice(__input);
25434 Bytes::new(&payload_buf)
25435 } else {
25436 Bytes::new(__input)
25437 };
25438 let mut __struct = Self::default();
25439 __struct.time_boot_ms = buf.get_u32_le();
25440 __struct.chan1_scaled = buf.get_i16_le();
25441 __struct.chan2_scaled = buf.get_i16_le();
25442 __struct.chan3_scaled = buf.get_i16_le();
25443 __struct.chan4_scaled = buf.get_i16_le();
25444 __struct.chan5_scaled = buf.get_i16_le();
25445 __struct.chan6_scaled = buf.get_i16_le();
25446 __struct.chan7_scaled = buf.get_i16_le();
25447 __struct.chan8_scaled = buf.get_i16_le();
25448 __struct.port = buf.get_u8();
25449 __struct.rssi = buf.get_u8();
25450 Ok(__struct)
25451 }
25452 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25453 let mut __tmp = BytesMut::new(bytes);
25454 #[allow(clippy::absurd_extreme_comparisons)]
25455 #[allow(unused_comparisons)]
25456 if __tmp.remaining() < Self::ENCODED_LEN {
25457 panic!(
25458 "buffer is too small (need {} bytes, but got {})",
25459 Self::ENCODED_LEN,
25460 __tmp.remaining(),
25461 )
25462 }
25463 __tmp.put_u32_le(self.time_boot_ms);
25464 __tmp.put_i16_le(self.chan1_scaled);
25465 __tmp.put_i16_le(self.chan2_scaled);
25466 __tmp.put_i16_le(self.chan3_scaled);
25467 __tmp.put_i16_le(self.chan4_scaled);
25468 __tmp.put_i16_le(self.chan5_scaled);
25469 __tmp.put_i16_le(self.chan6_scaled);
25470 __tmp.put_i16_le(self.chan7_scaled);
25471 __tmp.put_i16_le(self.chan8_scaled);
25472 __tmp.put_u8(self.port);
25473 __tmp.put_u8(self.rssi);
25474 if matches!(version, MavlinkVersion::V2) {
25475 let len = __tmp.len();
25476 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25477 } else {
25478 __tmp.len()
25479 }
25480 }
25481}
25482#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25483#[doc = "Request a data stream."]
25484#[doc = ""]
25485#[doc = "ID: 66"]
25486#[derive(Debug, Clone, PartialEq)]
25487#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25489pub struct REQUEST_DATA_STREAM_DATA {
25490 #[doc = "The requested message rate"]
25491 pub req_message_rate: u16,
25492 #[doc = "The target requested to send the message stream."]
25493 pub target_system: u8,
25494 #[doc = "The target requested to send the message stream."]
25495 pub target_component: u8,
25496 #[doc = "The ID of the requested data stream"]
25497 pub req_stream_id: u8,
25498 #[doc = "1 to start sending, 0 to stop sending."]
25499 pub start_stop: u8,
25500}
25501impl REQUEST_DATA_STREAM_DATA {
25502 pub const ENCODED_LEN: usize = 6usize;
25503 pub const DEFAULT: Self = Self {
25504 req_message_rate: 0_u16,
25505 target_system: 0_u8,
25506 target_component: 0_u8,
25507 req_stream_id: 0_u8,
25508 start_stop: 0_u8,
25509 };
25510 #[cfg(feature = "arbitrary")]
25511 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25512 use arbitrary::{Arbitrary, Unstructured};
25513 let mut buf = [0u8; 1024];
25514 rng.fill_bytes(&mut buf);
25515 let mut unstructured = Unstructured::new(&buf);
25516 Self::arbitrary(&mut unstructured).unwrap_or_default()
25517 }
25518}
25519impl Default for REQUEST_DATA_STREAM_DATA {
25520 fn default() -> Self {
25521 Self::DEFAULT.clone()
25522 }
25523}
25524impl MessageData for REQUEST_DATA_STREAM_DATA {
25525 type Message = MavMessage;
25526 const ID: u32 = 66u32;
25527 const NAME: &'static str = "REQUEST_DATA_STREAM";
25528 const EXTRA_CRC: u8 = 148u8;
25529 const ENCODED_LEN: usize = 6usize;
25530 fn deser(
25531 _version: MavlinkVersion,
25532 __input: &[u8],
25533 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25534 let avail_len = __input.len();
25535 let mut payload_buf = [0; Self::ENCODED_LEN];
25536 let mut buf = if avail_len < Self::ENCODED_LEN {
25537 payload_buf[0..avail_len].copy_from_slice(__input);
25538 Bytes::new(&payload_buf)
25539 } else {
25540 Bytes::new(__input)
25541 };
25542 let mut __struct = Self::default();
25543 __struct.req_message_rate = buf.get_u16_le();
25544 __struct.target_system = buf.get_u8();
25545 __struct.target_component = buf.get_u8();
25546 __struct.req_stream_id = buf.get_u8();
25547 __struct.start_stop = buf.get_u8();
25548 Ok(__struct)
25549 }
25550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25551 let mut __tmp = BytesMut::new(bytes);
25552 #[allow(clippy::absurd_extreme_comparisons)]
25553 #[allow(unused_comparisons)]
25554 if __tmp.remaining() < Self::ENCODED_LEN {
25555 panic!(
25556 "buffer is too small (need {} bytes, but got {})",
25557 Self::ENCODED_LEN,
25558 __tmp.remaining(),
25559 )
25560 }
25561 __tmp.put_u16_le(self.req_message_rate);
25562 __tmp.put_u8(self.target_system);
25563 __tmp.put_u8(self.target_component);
25564 __tmp.put_u8(self.req_stream_id);
25565 __tmp.put_u8(self.start_stop);
25566 if matches!(version, MavlinkVersion::V2) {
25567 let len = __tmp.len();
25568 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25569 } else {
25570 __tmp.len()
25571 }
25572 }
25573}
25574#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
25575#[doc = ""]
25576#[doc = "ID: 412"]
25577#[derive(Debug, Clone, PartialEq)]
25578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25580pub struct REQUEST_EVENT_DATA {
25581 #[doc = "First sequence number of the requested event."]
25582 pub first_sequence: u16,
25583 #[doc = "Last sequence number of the requested event."]
25584 pub last_sequence: u16,
25585 #[doc = "System ID"]
25586 pub target_system: u8,
25587 #[doc = "Component ID"]
25588 pub target_component: u8,
25589}
25590impl REQUEST_EVENT_DATA {
25591 pub const ENCODED_LEN: usize = 6usize;
25592 pub const DEFAULT: Self = Self {
25593 first_sequence: 0_u16,
25594 last_sequence: 0_u16,
25595 target_system: 0_u8,
25596 target_component: 0_u8,
25597 };
25598 #[cfg(feature = "arbitrary")]
25599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25600 use arbitrary::{Arbitrary, Unstructured};
25601 let mut buf = [0u8; 1024];
25602 rng.fill_bytes(&mut buf);
25603 let mut unstructured = Unstructured::new(&buf);
25604 Self::arbitrary(&mut unstructured).unwrap_or_default()
25605 }
25606}
25607impl Default for REQUEST_EVENT_DATA {
25608 fn default() -> Self {
25609 Self::DEFAULT.clone()
25610 }
25611}
25612impl MessageData for REQUEST_EVENT_DATA {
25613 type Message = MavMessage;
25614 const ID: u32 = 412u32;
25615 const NAME: &'static str = "REQUEST_EVENT";
25616 const EXTRA_CRC: u8 = 33u8;
25617 const ENCODED_LEN: usize = 6usize;
25618 fn deser(
25619 _version: MavlinkVersion,
25620 __input: &[u8],
25621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25622 let avail_len = __input.len();
25623 let mut payload_buf = [0; Self::ENCODED_LEN];
25624 let mut buf = if avail_len < Self::ENCODED_LEN {
25625 payload_buf[0..avail_len].copy_from_slice(__input);
25626 Bytes::new(&payload_buf)
25627 } else {
25628 Bytes::new(__input)
25629 };
25630 let mut __struct = Self::default();
25631 __struct.first_sequence = buf.get_u16_le();
25632 __struct.last_sequence = buf.get_u16_le();
25633 __struct.target_system = buf.get_u8();
25634 __struct.target_component = buf.get_u8();
25635 Ok(__struct)
25636 }
25637 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25638 let mut __tmp = BytesMut::new(bytes);
25639 #[allow(clippy::absurd_extreme_comparisons)]
25640 #[allow(unused_comparisons)]
25641 if __tmp.remaining() < Self::ENCODED_LEN {
25642 panic!(
25643 "buffer is too small (need {} bytes, but got {})",
25644 Self::ENCODED_LEN,
25645 __tmp.remaining(),
25646 )
25647 }
25648 __tmp.put_u16_le(self.first_sequence);
25649 __tmp.put_u16_le(self.last_sequence);
25650 __tmp.put_u8(self.target_system);
25651 __tmp.put_u8(self.target_component);
25652 if matches!(version, MavlinkVersion::V2) {
25653 let len = __tmp.len();
25654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25655 } else {
25656 __tmp.len()
25657 }
25658 }
25659}
25660#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25661#[doc = ""]
25662#[doc = "ID: 142"]
25663#[derive(Debug, Clone, PartialEq)]
25664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25666pub struct RESOURCE_REQUEST_DATA {
25667 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25668 pub request_id: u8,
25669 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25670 pub uri_type: u8,
25671 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25672 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25673 pub uri: [u8; 120],
25674 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25675 pub transfer_type: u8,
25676 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25677 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25678 pub storage: [u8; 120],
25679}
25680impl RESOURCE_REQUEST_DATA {
25681 pub const ENCODED_LEN: usize = 243usize;
25682 pub const DEFAULT: Self = Self {
25683 request_id: 0_u8,
25684 uri_type: 0_u8,
25685 uri: [0_u8; 120usize],
25686 transfer_type: 0_u8,
25687 storage: [0_u8; 120usize],
25688 };
25689 #[cfg(feature = "arbitrary")]
25690 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25691 use arbitrary::{Arbitrary, Unstructured};
25692 let mut buf = [0u8; 1024];
25693 rng.fill_bytes(&mut buf);
25694 let mut unstructured = Unstructured::new(&buf);
25695 Self::arbitrary(&mut unstructured).unwrap_or_default()
25696 }
25697}
25698impl Default for RESOURCE_REQUEST_DATA {
25699 fn default() -> Self {
25700 Self::DEFAULT.clone()
25701 }
25702}
25703impl MessageData for RESOURCE_REQUEST_DATA {
25704 type Message = MavMessage;
25705 const ID: u32 = 142u32;
25706 const NAME: &'static str = "RESOURCE_REQUEST";
25707 const EXTRA_CRC: u8 = 72u8;
25708 const ENCODED_LEN: usize = 243usize;
25709 fn deser(
25710 _version: MavlinkVersion,
25711 __input: &[u8],
25712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25713 let avail_len = __input.len();
25714 let mut payload_buf = [0; Self::ENCODED_LEN];
25715 let mut buf = if avail_len < Self::ENCODED_LEN {
25716 payload_buf[0..avail_len].copy_from_slice(__input);
25717 Bytes::new(&payload_buf)
25718 } else {
25719 Bytes::new(__input)
25720 };
25721 let mut __struct = Self::default();
25722 __struct.request_id = buf.get_u8();
25723 __struct.uri_type = buf.get_u8();
25724 for v in &mut __struct.uri {
25725 let val = buf.get_u8();
25726 *v = val;
25727 }
25728 __struct.transfer_type = buf.get_u8();
25729 for v in &mut __struct.storage {
25730 let val = buf.get_u8();
25731 *v = val;
25732 }
25733 Ok(__struct)
25734 }
25735 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25736 let mut __tmp = BytesMut::new(bytes);
25737 #[allow(clippy::absurd_extreme_comparisons)]
25738 #[allow(unused_comparisons)]
25739 if __tmp.remaining() < Self::ENCODED_LEN {
25740 panic!(
25741 "buffer is too small (need {} bytes, but got {})",
25742 Self::ENCODED_LEN,
25743 __tmp.remaining(),
25744 )
25745 }
25746 __tmp.put_u8(self.request_id);
25747 __tmp.put_u8(self.uri_type);
25748 for val in &self.uri {
25749 __tmp.put_u8(*val);
25750 }
25751 __tmp.put_u8(self.transfer_type);
25752 for val in &self.storage {
25753 __tmp.put_u8(*val);
25754 }
25755 if matches!(version, MavlinkVersion::V2) {
25756 let len = __tmp.len();
25757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25758 } else {
25759 __tmp.len()
25760 }
25761 }
25762}
25763#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
25764#[doc = ""]
25765#[doc = "ID: 413"]
25766#[derive(Debug, Clone, PartialEq)]
25767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25769pub struct RESPONSE_EVENT_ERROR_DATA {
25770 #[doc = "Sequence number."]
25771 pub sequence: u16,
25772 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
25773 pub sequence_oldest_available: u16,
25774 #[doc = "System ID"]
25775 pub target_system: u8,
25776 #[doc = "Component ID"]
25777 pub target_component: u8,
25778 #[doc = "Error reason."]
25779 pub reason: MavEventErrorReason,
25780}
25781impl RESPONSE_EVENT_ERROR_DATA {
25782 pub const ENCODED_LEN: usize = 7usize;
25783 pub const DEFAULT: Self = Self {
25784 sequence: 0_u16,
25785 sequence_oldest_available: 0_u16,
25786 target_system: 0_u8,
25787 target_component: 0_u8,
25788 reason: MavEventErrorReason::DEFAULT,
25789 };
25790 #[cfg(feature = "arbitrary")]
25791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25792 use arbitrary::{Arbitrary, Unstructured};
25793 let mut buf = [0u8; 1024];
25794 rng.fill_bytes(&mut buf);
25795 let mut unstructured = Unstructured::new(&buf);
25796 Self::arbitrary(&mut unstructured).unwrap_or_default()
25797 }
25798}
25799impl Default for RESPONSE_EVENT_ERROR_DATA {
25800 fn default() -> Self {
25801 Self::DEFAULT.clone()
25802 }
25803}
25804impl MessageData for RESPONSE_EVENT_ERROR_DATA {
25805 type Message = MavMessage;
25806 const ID: u32 = 413u32;
25807 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
25808 const EXTRA_CRC: u8 = 77u8;
25809 const ENCODED_LEN: usize = 7usize;
25810 fn deser(
25811 _version: MavlinkVersion,
25812 __input: &[u8],
25813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25814 let avail_len = __input.len();
25815 let mut payload_buf = [0; Self::ENCODED_LEN];
25816 let mut buf = if avail_len < Self::ENCODED_LEN {
25817 payload_buf[0..avail_len].copy_from_slice(__input);
25818 Bytes::new(&payload_buf)
25819 } else {
25820 Bytes::new(__input)
25821 };
25822 let mut __struct = Self::default();
25823 __struct.sequence = buf.get_u16_le();
25824 __struct.sequence_oldest_available = buf.get_u16_le();
25825 __struct.target_system = buf.get_u8();
25826 __struct.target_component = buf.get_u8();
25827 let tmp = buf.get_u8();
25828 __struct.reason =
25829 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25830 enum_type: "MavEventErrorReason",
25831 value: tmp as u32,
25832 })?;
25833 Ok(__struct)
25834 }
25835 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25836 let mut __tmp = BytesMut::new(bytes);
25837 #[allow(clippy::absurd_extreme_comparisons)]
25838 #[allow(unused_comparisons)]
25839 if __tmp.remaining() < Self::ENCODED_LEN {
25840 panic!(
25841 "buffer is too small (need {} bytes, but got {})",
25842 Self::ENCODED_LEN,
25843 __tmp.remaining(),
25844 )
25845 }
25846 __tmp.put_u16_le(self.sequence);
25847 __tmp.put_u16_le(self.sequence_oldest_available);
25848 __tmp.put_u8(self.target_system);
25849 __tmp.put_u8(self.target_component);
25850 __tmp.put_u8(self.reason as u8);
25851 if matches!(version, MavlinkVersion::V2) {
25852 let len = __tmp.len();
25853 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25854 } else {
25855 __tmp.len()
25856 }
25857 }
25858}
25859#[doc = "Read out the safety zone the MAV currently assumes."]
25860#[doc = ""]
25861#[doc = "ID: 55"]
25862#[derive(Debug, Clone, PartialEq)]
25863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25865pub struct SAFETY_ALLOWED_AREA_DATA {
25866 #[doc = "x position 1 / Latitude 1"]
25867 pub p1x: f32,
25868 #[doc = "y position 1 / Longitude 1"]
25869 pub p1y: f32,
25870 #[doc = "z position 1 / Altitude 1"]
25871 pub p1z: f32,
25872 #[doc = "x position 2 / Latitude 2"]
25873 pub p2x: f32,
25874 #[doc = "y position 2 / Longitude 2"]
25875 pub p2y: f32,
25876 #[doc = "z position 2 / Altitude 2"]
25877 pub p2z: f32,
25878 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25879 pub frame: MavFrame,
25880}
25881impl SAFETY_ALLOWED_AREA_DATA {
25882 pub const ENCODED_LEN: usize = 25usize;
25883 pub const DEFAULT: Self = Self {
25884 p1x: 0.0_f32,
25885 p1y: 0.0_f32,
25886 p1z: 0.0_f32,
25887 p2x: 0.0_f32,
25888 p2y: 0.0_f32,
25889 p2z: 0.0_f32,
25890 frame: MavFrame::DEFAULT,
25891 };
25892 #[cfg(feature = "arbitrary")]
25893 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25894 use arbitrary::{Arbitrary, Unstructured};
25895 let mut buf = [0u8; 1024];
25896 rng.fill_bytes(&mut buf);
25897 let mut unstructured = Unstructured::new(&buf);
25898 Self::arbitrary(&mut unstructured).unwrap_or_default()
25899 }
25900}
25901impl Default for SAFETY_ALLOWED_AREA_DATA {
25902 fn default() -> Self {
25903 Self::DEFAULT.clone()
25904 }
25905}
25906impl MessageData for SAFETY_ALLOWED_AREA_DATA {
25907 type Message = MavMessage;
25908 const ID: u32 = 55u32;
25909 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
25910 const EXTRA_CRC: u8 = 3u8;
25911 const ENCODED_LEN: usize = 25usize;
25912 fn deser(
25913 _version: MavlinkVersion,
25914 __input: &[u8],
25915 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25916 let avail_len = __input.len();
25917 let mut payload_buf = [0; Self::ENCODED_LEN];
25918 let mut buf = if avail_len < Self::ENCODED_LEN {
25919 payload_buf[0..avail_len].copy_from_slice(__input);
25920 Bytes::new(&payload_buf)
25921 } else {
25922 Bytes::new(__input)
25923 };
25924 let mut __struct = Self::default();
25925 __struct.p1x = buf.get_f32_le();
25926 __struct.p1y = buf.get_f32_le();
25927 __struct.p1z = buf.get_f32_le();
25928 __struct.p2x = buf.get_f32_le();
25929 __struct.p2y = buf.get_f32_le();
25930 __struct.p2z = buf.get_f32_le();
25931 let tmp = buf.get_u8();
25932 __struct.frame =
25933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25934 enum_type: "MavFrame",
25935 value: tmp as u32,
25936 })?;
25937 Ok(__struct)
25938 }
25939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25940 let mut __tmp = BytesMut::new(bytes);
25941 #[allow(clippy::absurd_extreme_comparisons)]
25942 #[allow(unused_comparisons)]
25943 if __tmp.remaining() < Self::ENCODED_LEN {
25944 panic!(
25945 "buffer is too small (need {} bytes, but got {})",
25946 Self::ENCODED_LEN,
25947 __tmp.remaining(),
25948 )
25949 }
25950 __tmp.put_f32_le(self.p1x);
25951 __tmp.put_f32_le(self.p1y);
25952 __tmp.put_f32_le(self.p1z);
25953 __tmp.put_f32_le(self.p2x);
25954 __tmp.put_f32_le(self.p2y);
25955 __tmp.put_f32_le(self.p2z);
25956 __tmp.put_u8(self.frame as u8);
25957 if matches!(version, MavlinkVersion::V2) {
25958 let len = __tmp.len();
25959 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25960 } else {
25961 __tmp.len()
25962 }
25963 }
25964}
25965#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
25966#[doc = ""]
25967#[doc = "ID: 54"]
25968#[derive(Debug, Clone, PartialEq)]
25969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25970#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25971pub struct SAFETY_SET_ALLOWED_AREA_DATA {
25972 #[doc = "x position 1 / Latitude 1"]
25973 pub p1x: f32,
25974 #[doc = "y position 1 / Longitude 1"]
25975 pub p1y: f32,
25976 #[doc = "z position 1 / Altitude 1"]
25977 pub p1z: f32,
25978 #[doc = "x position 2 / Latitude 2"]
25979 pub p2x: f32,
25980 #[doc = "y position 2 / Longitude 2"]
25981 pub p2y: f32,
25982 #[doc = "z position 2 / Altitude 2"]
25983 pub p2z: f32,
25984 #[doc = "System ID"]
25985 pub target_system: u8,
25986 #[doc = "Component ID"]
25987 pub target_component: u8,
25988 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25989 pub frame: MavFrame,
25990}
25991impl SAFETY_SET_ALLOWED_AREA_DATA {
25992 pub const ENCODED_LEN: usize = 27usize;
25993 pub const DEFAULT: Self = Self {
25994 p1x: 0.0_f32,
25995 p1y: 0.0_f32,
25996 p1z: 0.0_f32,
25997 p2x: 0.0_f32,
25998 p2y: 0.0_f32,
25999 p2z: 0.0_f32,
26000 target_system: 0_u8,
26001 target_component: 0_u8,
26002 frame: MavFrame::DEFAULT,
26003 };
26004 #[cfg(feature = "arbitrary")]
26005 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26006 use arbitrary::{Arbitrary, Unstructured};
26007 let mut buf = [0u8; 1024];
26008 rng.fill_bytes(&mut buf);
26009 let mut unstructured = Unstructured::new(&buf);
26010 Self::arbitrary(&mut unstructured).unwrap_or_default()
26011 }
26012}
26013impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26014 fn default() -> Self {
26015 Self::DEFAULT.clone()
26016 }
26017}
26018impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26019 type Message = MavMessage;
26020 const ID: u32 = 54u32;
26021 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26022 const EXTRA_CRC: u8 = 15u8;
26023 const ENCODED_LEN: usize = 27usize;
26024 fn deser(
26025 _version: MavlinkVersion,
26026 __input: &[u8],
26027 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26028 let avail_len = __input.len();
26029 let mut payload_buf = [0; Self::ENCODED_LEN];
26030 let mut buf = if avail_len < Self::ENCODED_LEN {
26031 payload_buf[0..avail_len].copy_from_slice(__input);
26032 Bytes::new(&payload_buf)
26033 } else {
26034 Bytes::new(__input)
26035 };
26036 let mut __struct = Self::default();
26037 __struct.p1x = buf.get_f32_le();
26038 __struct.p1y = buf.get_f32_le();
26039 __struct.p1z = buf.get_f32_le();
26040 __struct.p2x = buf.get_f32_le();
26041 __struct.p2y = buf.get_f32_le();
26042 __struct.p2z = buf.get_f32_le();
26043 __struct.target_system = buf.get_u8();
26044 __struct.target_component = buf.get_u8();
26045 let tmp = buf.get_u8();
26046 __struct.frame =
26047 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26048 enum_type: "MavFrame",
26049 value: tmp as u32,
26050 })?;
26051 Ok(__struct)
26052 }
26053 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26054 let mut __tmp = BytesMut::new(bytes);
26055 #[allow(clippy::absurd_extreme_comparisons)]
26056 #[allow(unused_comparisons)]
26057 if __tmp.remaining() < Self::ENCODED_LEN {
26058 panic!(
26059 "buffer is too small (need {} bytes, but got {})",
26060 Self::ENCODED_LEN,
26061 __tmp.remaining(),
26062 )
26063 }
26064 __tmp.put_f32_le(self.p1x);
26065 __tmp.put_f32_le(self.p1y);
26066 __tmp.put_f32_le(self.p1z);
26067 __tmp.put_f32_le(self.p2x);
26068 __tmp.put_f32_le(self.p2y);
26069 __tmp.put_f32_le(self.p2z);
26070 __tmp.put_u8(self.target_system);
26071 __tmp.put_u8(self.target_component);
26072 __tmp.put_u8(self.frame as u8);
26073 if matches!(version, MavlinkVersion::V2) {
26074 let len = __tmp.len();
26075 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26076 } else {
26077 __tmp.len()
26078 }
26079 }
26080}
26081#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26082#[doc = ""]
26083#[doc = "ID: 26"]
26084#[derive(Debug, Clone, PartialEq)]
26085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26087pub struct SCALED_IMU_DATA {
26088 #[doc = "Timestamp (time since system boot)."]
26089 pub time_boot_ms: u32,
26090 #[doc = "X acceleration"]
26091 pub xacc: i16,
26092 #[doc = "Y acceleration"]
26093 pub yacc: i16,
26094 #[doc = "Z acceleration"]
26095 pub zacc: i16,
26096 #[doc = "Angular speed around X axis"]
26097 pub xgyro: i16,
26098 #[doc = "Angular speed around Y axis"]
26099 pub ygyro: i16,
26100 #[doc = "Angular speed around Z axis"]
26101 pub zgyro: i16,
26102 #[doc = "X Magnetic field"]
26103 pub xmag: i16,
26104 #[doc = "Y Magnetic field"]
26105 pub ymag: i16,
26106 #[doc = "Z Magnetic field"]
26107 pub zmag: i16,
26108 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26109 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26110 pub temperature: i16,
26111}
26112impl SCALED_IMU_DATA {
26113 pub const ENCODED_LEN: usize = 24usize;
26114 pub const DEFAULT: Self = Self {
26115 time_boot_ms: 0_u32,
26116 xacc: 0_i16,
26117 yacc: 0_i16,
26118 zacc: 0_i16,
26119 xgyro: 0_i16,
26120 ygyro: 0_i16,
26121 zgyro: 0_i16,
26122 xmag: 0_i16,
26123 ymag: 0_i16,
26124 zmag: 0_i16,
26125 temperature: 0_i16,
26126 };
26127 #[cfg(feature = "arbitrary")]
26128 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26129 use arbitrary::{Arbitrary, Unstructured};
26130 let mut buf = [0u8; 1024];
26131 rng.fill_bytes(&mut buf);
26132 let mut unstructured = Unstructured::new(&buf);
26133 Self::arbitrary(&mut unstructured).unwrap_or_default()
26134 }
26135}
26136impl Default for SCALED_IMU_DATA {
26137 fn default() -> Self {
26138 Self::DEFAULT.clone()
26139 }
26140}
26141impl MessageData for SCALED_IMU_DATA {
26142 type Message = MavMessage;
26143 const ID: u32 = 26u32;
26144 const NAME: &'static str = "SCALED_IMU";
26145 const EXTRA_CRC: u8 = 170u8;
26146 const ENCODED_LEN: usize = 24usize;
26147 fn deser(
26148 _version: MavlinkVersion,
26149 __input: &[u8],
26150 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26151 let avail_len = __input.len();
26152 let mut payload_buf = [0; Self::ENCODED_LEN];
26153 let mut buf = if avail_len < Self::ENCODED_LEN {
26154 payload_buf[0..avail_len].copy_from_slice(__input);
26155 Bytes::new(&payload_buf)
26156 } else {
26157 Bytes::new(__input)
26158 };
26159 let mut __struct = Self::default();
26160 __struct.time_boot_ms = buf.get_u32_le();
26161 __struct.xacc = buf.get_i16_le();
26162 __struct.yacc = buf.get_i16_le();
26163 __struct.zacc = buf.get_i16_le();
26164 __struct.xgyro = buf.get_i16_le();
26165 __struct.ygyro = buf.get_i16_le();
26166 __struct.zgyro = buf.get_i16_le();
26167 __struct.xmag = buf.get_i16_le();
26168 __struct.ymag = buf.get_i16_le();
26169 __struct.zmag = buf.get_i16_le();
26170 __struct.temperature = buf.get_i16_le();
26171 Ok(__struct)
26172 }
26173 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26174 let mut __tmp = BytesMut::new(bytes);
26175 #[allow(clippy::absurd_extreme_comparisons)]
26176 #[allow(unused_comparisons)]
26177 if __tmp.remaining() < Self::ENCODED_LEN {
26178 panic!(
26179 "buffer is too small (need {} bytes, but got {})",
26180 Self::ENCODED_LEN,
26181 __tmp.remaining(),
26182 )
26183 }
26184 __tmp.put_u32_le(self.time_boot_ms);
26185 __tmp.put_i16_le(self.xacc);
26186 __tmp.put_i16_le(self.yacc);
26187 __tmp.put_i16_le(self.zacc);
26188 __tmp.put_i16_le(self.xgyro);
26189 __tmp.put_i16_le(self.ygyro);
26190 __tmp.put_i16_le(self.zgyro);
26191 __tmp.put_i16_le(self.xmag);
26192 __tmp.put_i16_le(self.ymag);
26193 __tmp.put_i16_le(self.zmag);
26194 if matches!(version, MavlinkVersion::V2) {
26195 __tmp.put_i16_le(self.temperature);
26196 let len = __tmp.len();
26197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26198 } else {
26199 __tmp.len()
26200 }
26201 }
26202}
26203#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26204#[doc = ""]
26205#[doc = "ID: 116"]
26206#[derive(Debug, Clone, PartialEq)]
26207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26209pub struct SCALED_IMU2_DATA {
26210 #[doc = "Timestamp (time since system boot)."]
26211 pub time_boot_ms: u32,
26212 #[doc = "X acceleration"]
26213 pub xacc: i16,
26214 #[doc = "Y acceleration"]
26215 pub yacc: i16,
26216 #[doc = "Z acceleration"]
26217 pub zacc: i16,
26218 #[doc = "Angular speed around X axis"]
26219 pub xgyro: i16,
26220 #[doc = "Angular speed around Y axis"]
26221 pub ygyro: i16,
26222 #[doc = "Angular speed around Z axis"]
26223 pub zgyro: i16,
26224 #[doc = "X Magnetic field"]
26225 pub xmag: i16,
26226 #[doc = "Y Magnetic field"]
26227 pub ymag: i16,
26228 #[doc = "Z Magnetic field"]
26229 pub zmag: i16,
26230 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26231 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26232 pub temperature: i16,
26233}
26234impl SCALED_IMU2_DATA {
26235 pub const ENCODED_LEN: usize = 24usize;
26236 pub const DEFAULT: Self = Self {
26237 time_boot_ms: 0_u32,
26238 xacc: 0_i16,
26239 yacc: 0_i16,
26240 zacc: 0_i16,
26241 xgyro: 0_i16,
26242 ygyro: 0_i16,
26243 zgyro: 0_i16,
26244 xmag: 0_i16,
26245 ymag: 0_i16,
26246 zmag: 0_i16,
26247 temperature: 0_i16,
26248 };
26249 #[cfg(feature = "arbitrary")]
26250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26251 use arbitrary::{Arbitrary, Unstructured};
26252 let mut buf = [0u8; 1024];
26253 rng.fill_bytes(&mut buf);
26254 let mut unstructured = Unstructured::new(&buf);
26255 Self::arbitrary(&mut unstructured).unwrap_or_default()
26256 }
26257}
26258impl Default for SCALED_IMU2_DATA {
26259 fn default() -> Self {
26260 Self::DEFAULT.clone()
26261 }
26262}
26263impl MessageData for SCALED_IMU2_DATA {
26264 type Message = MavMessage;
26265 const ID: u32 = 116u32;
26266 const NAME: &'static str = "SCALED_IMU2";
26267 const EXTRA_CRC: u8 = 76u8;
26268 const ENCODED_LEN: usize = 24usize;
26269 fn deser(
26270 _version: MavlinkVersion,
26271 __input: &[u8],
26272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26273 let avail_len = __input.len();
26274 let mut payload_buf = [0; Self::ENCODED_LEN];
26275 let mut buf = if avail_len < Self::ENCODED_LEN {
26276 payload_buf[0..avail_len].copy_from_slice(__input);
26277 Bytes::new(&payload_buf)
26278 } else {
26279 Bytes::new(__input)
26280 };
26281 let mut __struct = Self::default();
26282 __struct.time_boot_ms = buf.get_u32_le();
26283 __struct.xacc = buf.get_i16_le();
26284 __struct.yacc = buf.get_i16_le();
26285 __struct.zacc = buf.get_i16_le();
26286 __struct.xgyro = buf.get_i16_le();
26287 __struct.ygyro = buf.get_i16_le();
26288 __struct.zgyro = buf.get_i16_le();
26289 __struct.xmag = buf.get_i16_le();
26290 __struct.ymag = buf.get_i16_le();
26291 __struct.zmag = buf.get_i16_le();
26292 __struct.temperature = buf.get_i16_le();
26293 Ok(__struct)
26294 }
26295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26296 let mut __tmp = BytesMut::new(bytes);
26297 #[allow(clippy::absurd_extreme_comparisons)]
26298 #[allow(unused_comparisons)]
26299 if __tmp.remaining() < Self::ENCODED_LEN {
26300 panic!(
26301 "buffer is too small (need {} bytes, but got {})",
26302 Self::ENCODED_LEN,
26303 __tmp.remaining(),
26304 )
26305 }
26306 __tmp.put_u32_le(self.time_boot_ms);
26307 __tmp.put_i16_le(self.xacc);
26308 __tmp.put_i16_le(self.yacc);
26309 __tmp.put_i16_le(self.zacc);
26310 __tmp.put_i16_le(self.xgyro);
26311 __tmp.put_i16_le(self.ygyro);
26312 __tmp.put_i16_le(self.zgyro);
26313 __tmp.put_i16_le(self.xmag);
26314 __tmp.put_i16_le(self.ymag);
26315 __tmp.put_i16_le(self.zmag);
26316 if matches!(version, MavlinkVersion::V2) {
26317 __tmp.put_i16_le(self.temperature);
26318 let len = __tmp.len();
26319 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26320 } else {
26321 __tmp.len()
26322 }
26323 }
26324}
26325#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26326#[doc = ""]
26327#[doc = "ID: 129"]
26328#[derive(Debug, Clone, PartialEq)]
26329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26331pub struct SCALED_IMU3_DATA {
26332 #[doc = "Timestamp (time since system boot)."]
26333 pub time_boot_ms: u32,
26334 #[doc = "X acceleration"]
26335 pub xacc: i16,
26336 #[doc = "Y acceleration"]
26337 pub yacc: i16,
26338 #[doc = "Z acceleration"]
26339 pub zacc: i16,
26340 #[doc = "Angular speed around X axis"]
26341 pub xgyro: i16,
26342 #[doc = "Angular speed around Y axis"]
26343 pub ygyro: i16,
26344 #[doc = "Angular speed around Z axis"]
26345 pub zgyro: i16,
26346 #[doc = "X Magnetic field"]
26347 pub xmag: i16,
26348 #[doc = "Y Magnetic field"]
26349 pub ymag: i16,
26350 #[doc = "Z Magnetic field"]
26351 pub zmag: i16,
26352 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26353 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26354 pub temperature: i16,
26355}
26356impl SCALED_IMU3_DATA {
26357 pub const ENCODED_LEN: usize = 24usize;
26358 pub const DEFAULT: Self = Self {
26359 time_boot_ms: 0_u32,
26360 xacc: 0_i16,
26361 yacc: 0_i16,
26362 zacc: 0_i16,
26363 xgyro: 0_i16,
26364 ygyro: 0_i16,
26365 zgyro: 0_i16,
26366 xmag: 0_i16,
26367 ymag: 0_i16,
26368 zmag: 0_i16,
26369 temperature: 0_i16,
26370 };
26371 #[cfg(feature = "arbitrary")]
26372 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26373 use arbitrary::{Arbitrary, Unstructured};
26374 let mut buf = [0u8; 1024];
26375 rng.fill_bytes(&mut buf);
26376 let mut unstructured = Unstructured::new(&buf);
26377 Self::arbitrary(&mut unstructured).unwrap_or_default()
26378 }
26379}
26380impl Default for SCALED_IMU3_DATA {
26381 fn default() -> Self {
26382 Self::DEFAULT.clone()
26383 }
26384}
26385impl MessageData for SCALED_IMU3_DATA {
26386 type Message = MavMessage;
26387 const ID: u32 = 129u32;
26388 const NAME: &'static str = "SCALED_IMU3";
26389 const EXTRA_CRC: u8 = 46u8;
26390 const ENCODED_LEN: usize = 24usize;
26391 fn deser(
26392 _version: MavlinkVersion,
26393 __input: &[u8],
26394 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26395 let avail_len = __input.len();
26396 let mut payload_buf = [0; Self::ENCODED_LEN];
26397 let mut buf = if avail_len < Self::ENCODED_LEN {
26398 payload_buf[0..avail_len].copy_from_slice(__input);
26399 Bytes::new(&payload_buf)
26400 } else {
26401 Bytes::new(__input)
26402 };
26403 let mut __struct = Self::default();
26404 __struct.time_boot_ms = buf.get_u32_le();
26405 __struct.xacc = buf.get_i16_le();
26406 __struct.yacc = buf.get_i16_le();
26407 __struct.zacc = buf.get_i16_le();
26408 __struct.xgyro = buf.get_i16_le();
26409 __struct.ygyro = buf.get_i16_le();
26410 __struct.zgyro = buf.get_i16_le();
26411 __struct.xmag = buf.get_i16_le();
26412 __struct.ymag = buf.get_i16_le();
26413 __struct.zmag = buf.get_i16_le();
26414 __struct.temperature = buf.get_i16_le();
26415 Ok(__struct)
26416 }
26417 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26418 let mut __tmp = BytesMut::new(bytes);
26419 #[allow(clippy::absurd_extreme_comparisons)]
26420 #[allow(unused_comparisons)]
26421 if __tmp.remaining() < Self::ENCODED_LEN {
26422 panic!(
26423 "buffer is too small (need {} bytes, but got {})",
26424 Self::ENCODED_LEN,
26425 __tmp.remaining(),
26426 )
26427 }
26428 __tmp.put_u32_le(self.time_boot_ms);
26429 __tmp.put_i16_le(self.xacc);
26430 __tmp.put_i16_le(self.yacc);
26431 __tmp.put_i16_le(self.zacc);
26432 __tmp.put_i16_le(self.xgyro);
26433 __tmp.put_i16_le(self.ygyro);
26434 __tmp.put_i16_le(self.zgyro);
26435 __tmp.put_i16_le(self.xmag);
26436 __tmp.put_i16_le(self.ymag);
26437 __tmp.put_i16_le(self.zmag);
26438 if matches!(version, MavlinkVersion::V2) {
26439 __tmp.put_i16_le(self.temperature);
26440 let len = __tmp.len();
26441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26442 } else {
26443 __tmp.len()
26444 }
26445 }
26446}
26447#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26448#[doc = ""]
26449#[doc = "ID: 29"]
26450#[derive(Debug, Clone, PartialEq)]
26451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26453pub struct SCALED_PRESSURE_DATA {
26454 #[doc = "Timestamp (time since system boot)."]
26455 pub time_boot_ms: u32,
26456 #[doc = "Absolute pressure"]
26457 pub press_abs: f32,
26458 #[doc = "Differential pressure 1"]
26459 pub press_diff: f32,
26460 #[doc = "Absolute pressure temperature"]
26461 pub temperature: i16,
26462 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26463 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26464 pub temperature_press_diff: i16,
26465}
26466impl SCALED_PRESSURE_DATA {
26467 pub const ENCODED_LEN: usize = 16usize;
26468 pub const DEFAULT: Self = Self {
26469 time_boot_ms: 0_u32,
26470 press_abs: 0.0_f32,
26471 press_diff: 0.0_f32,
26472 temperature: 0_i16,
26473 temperature_press_diff: 0_i16,
26474 };
26475 #[cfg(feature = "arbitrary")]
26476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26477 use arbitrary::{Arbitrary, Unstructured};
26478 let mut buf = [0u8; 1024];
26479 rng.fill_bytes(&mut buf);
26480 let mut unstructured = Unstructured::new(&buf);
26481 Self::arbitrary(&mut unstructured).unwrap_or_default()
26482 }
26483}
26484impl Default for SCALED_PRESSURE_DATA {
26485 fn default() -> Self {
26486 Self::DEFAULT.clone()
26487 }
26488}
26489impl MessageData for SCALED_PRESSURE_DATA {
26490 type Message = MavMessage;
26491 const ID: u32 = 29u32;
26492 const NAME: &'static str = "SCALED_PRESSURE";
26493 const EXTRA_CRC: u8 = 115u8;
26494 const ENCODED_LEN: usize = 16usize;
26495 fn deser(
26496 _version: MavlinkVersion,
26497 __input: &[u8],
26498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26499 let avail_len = __input.len();
26500 let mut payload_buf = [0; Self::ENCODED_LEN];
26501 let mut buf = if avail_len < Self::ENCODED_LEN {
26502 payload_buf[0..avail_len].copy_from_slice(__input);
26503 Bytes::new(&payload_buf)
26504 } else {
26505 Bytes::new(__input)
26506 };
26507 let mut __struct = Self::default();
26508 __struct.time_boot_ms = buf.get_u32_le();
26509 __struct.press_abs = buf.get_f32_le();
26510 __struct.press_diff = buf.get_f32_le();
26511 __struct.temperature = buf.get_i16_le();
26512 __struct.temperature_press_diff = buf.get_i16_le();
26513 Ok(__struct)
26514 }
26515 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26516 let mut __tmp = BytesMut::new(bytes);
26517 #[allow(clippy::absurd_extreme_comparisons)]
26518 #[allow(unused_comparisons)]
26519 if __tmp.remaining() < Self::ENCODED_LEN {
26520 panic!(
26521 "buffer is too small (need {} bytes, but got {})",
26522 Self::ENCODED_LEN,
26523 __tmp.remaining(),
26524 )
26525 }
26526 __tmp.put_u32_le(self.time_boot_ms);
26527 __tmp.put_f32_le(self.press_abs);
26528 __tmp.put_f32_le(self.press_diff);
26529 __tmp.put_i16_le(self.temperature);
26530 if matches!(version, MavlinkVersion::V2) {
26531 __tmp.put_i16_le(self.temperature_press_diff);
26532 let len = __tmp.len();
26533 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26534 } else {
26535 __tmp.len()
26536 }
26537 }
26538}
26539#[doc = "Barometer readings for 2nd barometer."]
26540#[doc = ""]
26541#[doc = "ID: 137"]
26542#[derive(Debug, Clone, PartialEq)]
26543#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26544#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26545pub struct SCALED_PRESSURE2_DATA {
26546 #[doc = "Timestamp (time since system boot)."]
26547 pub time_boot_ms: u32,
26548 #[doc = "Absolute pressure"]
26549 pub press_abs: f32,
26550 #[doc = "Differential pressure"]
26551 pub press_diff: f32,
26552 #[doc = "Absolute pressure temperature"]
26553 pub temperature: i16,
26554 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26555 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26556 pub temperature_press_diff: i16,
26557}
26558impl SCALED_PRESSURE2_DATA {
26559 pub const ENCODED_LEN: usize = 16usize;
26560 pub const DEFAULT: Self = Self {
26561 time_boot_ms: 0_u32,
26562 press_abs: 0.0_f32,
26563 press_diff: 0.0_f32,
26564 temperature: 0_i16,
26565 temperature_press_diff: 0_i16,
26566 };
26567 #[cfg(feature = "arbitrary")]
26568 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26569 use arbitrary::{Arbitrary, Unstructured};
26570 let mut buf = [0u8; 1024];
26571 rng.fill_bytes(&mut buf);
26572 let mut unstructured = Unstructured::new(&buf);
26573 Self::arbitrary(&mut unstructured).unwrap_or_default()
26574 }
26575}
26576impl Default for SCALED_PRESSURE2_DATA {
26577 fn default() -> Self {
26578 Self::DEFAULT.clone()
26579 }
26580}
26581impl MessageData for SCALED_PRESSURE2_DATA {
26582 type Message = MavMessage;
26583 const ID: u32 = 137u32;
26584 const NAME: &'static str = "SCALED_PRESSURE2";
26585 const EXTRA_CRC: u8 = 195u8;
26586 const ENCODED_LEN: usize = 16usize;
26587 fn deser(
26588 _version: MavlinkVersion,
26589 __input: &[u8],
26590 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26591 let avail_len = __input.len();
26592 let mut payload_buf = [0; Self::ENCODED_LEN];
26593 let mut buf = if avail_len < Self::ENCODED_LEN {
26594 payload_buf[0..avail_len].copy_from_slice(__input);
26595 Bytes::new(&payload_buf)
26596 } else {
26597 Bytes::new(__input)
26598 };
26599 let mut __struct = Self::default();
26600 __struct.time_boot_ms = buf.get_u32_le();
26601 __struct.press_abs = buf.get_f32_le();
26602 __struct.press_diff = buf.get_f32_le();
26603 __struct.temperature = buf.get_i16_le();
26604 __struct.temperature_press_diff = buf.get_i16_le();
26605 Ok(__struct)
26606 }
26607 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26608 let mut __tmp = BytesMut::new(bytes);
26609 #[allow(clippy::absurd_extreme_comparisons)]
26610 #[allow(unused_comparisons)]
26611 if __tmp.remaining() < Self::ENCODED_LEN {
26612 panic!(
26613 "buffer is too small (need {} bytes, but got {})",
26614 Self::ENCODED_LEN,
26615 __tmp.remaining(),
26616 )
26617 }
26618 __tmp.put_u32_le(self.time_boot_ms);
26619 __tmp.put_f32_le(self.press_abs);
26620 __tmp.put_f32_le(self.press_diff);
26621 __tmp.put_i16_le(self.temperature);
26622 if matches!(version, MavlinkVersion::V2) {
26623 __tmp.put_i16_le(self.temperature_press_diff);
26624 let len = __tmp.len();
26625 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26626 } else {
26627 __tmp.len()
26628 }
26629 }
26630}
26631#[doc = "Barometer readings for 3rd barometer."]
26632#[doc = ""]
26633#[doc = "ID: 143"]
26634#[derive(Debug, Clone, PartialEq)]
26635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26637pub struct SCALED_PRESSURE3_DATA {
26638 #[doc = "Timestamp (time since system boot)."]
26639 pub time_boot_ms: u32,
26640 #[doc = "Absolute pressure"]
26641 pub press_abs: f32,
26642 #[doc = "Differential pressure"]
26643 pub press_diff: f32,
26644 #[doc = "Absolute pressure temperature"]
26645 pub temperature: i16,
26646 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26647 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26648 pub temperature_press_diff: i16,
26649}
26650impl SCALED_PRESSURE3_DATA {
26651 pub const ENCODED_LEN: usize = 16usize;
26652 pub const DEFAULT: Self = Self {
26653 time_boot_ms: 0_u32,
26654 press_abs: 0.0_f32,
26655 press_diff: 0.0_f32,
26656 temperature: 0_i16,
26657 temperature_press_diff: 0_i16,
26658 };
26659 #[cfg(feature = "arbitrary")]
26660 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26661 use arbitrary::{Arbitrary, Unstructured};
26662 let mut buf = [0u8; 1024];
26663 rng.fill_bytes(&mut buf);
26664 let mut unstructured = Unstructured::new(&buf);
26665 Self::arbitrary(&mut unstructured).unwrap_or_default()
26666 }
26667}
26668impl Default for SCALED_PRESSURE3_DATA {
26669 fn default() -> Self {
26670 Self::DEFAULT.clone()
26671 }
26672}
26673impl MessageData for SCALED_PRESSURE3_DATA {
26674 type Message = MavMessage;
26675 const ID: u32 = 143u32;
26676 const NAME: &'static str = "SCALED_PRESSURE3";
26677 const EXTRA_CRC: u8 = 131u8;
26678 const ENCODED_LEN: usize = 16usize;
26679 fn deser(
26680 _version: MavlinkVersion,
26681 __input: &[u8],
26682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26683 let avail_len = __input.len();
26684 let mut payload_buf = [0; Self::ENCODED_LEN];
26685 let mut buf = if avail_len < Self::ENCODED_LEN {
26686 payload_buf[0..avail_len].copy_from_slice(__input);
26687 Bytes::new(&payload_buf)
26688 } else {
26689 Bytes::new(__input)
26690 };
26691 let mut __struct = Self::default();
26692 __struct.time_boot_ms = buf.get_u32_le();
26693 __struct.press_abs = buf.get_f32_le();
26694 __struct.press_diff = buf.get_f32_le();
26695 __struct.temperature = buf.get_i16_le();
26696 __struct.temperature_press_diff = buf.get_i16_le();
26697 Ok(__struct)
26698 }
26699 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26700 let mut __tmp = BytesMut::new(bytes);
26701 #[allow(clippy::absurd_extreme_comparisons)]
26702 #[allow(unused_comparisons)]
26703 if __tmp.remaining() < Self::ENCODED_LEN {
26704 panic!(
26705 "buffer is too small (need {} bytes, but got {})",
26706 Self::ENCODED_LEN,
26707 __tmp.remaining(),
26708 )
26709 }
26710 __tmp.put_u32_le(self.time_boot_ms);
26711 __tmp.put_f32_le(self.press_abs);
26712 __tmp.put_f32_le(self.press_diff);
26713 __tmp.put_i16_le(self.temperature);
26714 if matches!(version, MavlinkVersion::V2) {
26715 __tmp.put_i16_le(self.temperature_press_diff);
26716 let len = __tmp.len();
26717 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26718 } else {
26719 __tmp.len()
26720 }
26721 }
26722}
26723#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
26724#[doc = ""]
26725#[doc = "ID: 126"]
26726#[derive(Debug, Clone, PartialEq)]
26727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26729pub struct SERIAL_CONTROL_DATA {
26730 #[doc = "Baudrate of transfer. Zero means no change."]
26731 pub baudrate: u32,
26732 #[doc = "Timeout for reply data"]
26733 pub timeout: u16,
26734 #[doc = "Serial control device type."]
26735 pub device: SerialControlDev,
26736 #[doc = "Bitmap of serial control flags."]
26737 pub flags: SerialControlFlag,
26738 #[doc = "how many bytes in this transfer"]
26739 pub count: u8,
26740 #[doc = "serial data"]
26741 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26742 pub data: [u8; 70],
26743 #[doc = "System ID"]
26744 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26745 pub target_system: u8,
26746 #[doc = "Component ID"]
26747 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26748 pub target_component: u8,
26749}
26750impl SERIAL_CONTROL_DATA {
26751 pub const ENCODED_LEN: usize = 81usize;
26752 pub const DEFAULT: Self = Self {
26753 baudrate: 0_u32,
26754 timeout: 0_u16,
26755 device: SerialControlDev::DEFAULT,
26756 flags: SerialControlFlag::DEFAULT,
26757 count: 0_u8,
26758 data: [0_u8; 70usize],
26759 target_system: 0_u8,
26760 target_component: 0_u8,
26761 };
26762 #[cfg(feature = "arbitrary")]
26763 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26764 use arbitrary::{Arbitrary, Unstructured};
26765 let mut buf = [0u8; 1024];
26766 rng.fill_bytes(&mut buf);
26767 let mut unstructured = Unstructured::new(&buf);
26768 Self::arbitrary(&mut unstructured).unwrap_or_default()
26769 }
26770}
26771impl Default for SERIAL_CONTROL_DATA {
26772 fn default() -> Self {
26773 Self::DEFAULT.clone()
26774 }
26775}
26776impl MessageData for SERIAL_CONTROL_DATA {
26777 type Message = MavMessage;
26778 const ID: u32 = 126u32;
26779 const NAME: &'static str = "SERIAL_CONTROL";
26780 const EXTRA_CRC: u8 = 220u8;
26781 const ENCODED_LEN: usize = 81usize;
26782 fn deser(
26783 _version: MavlinkVersion,
26784 __input: &[u8],
26785 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26786 let avail_len = __input.len();
26787 let mut payload_buf = [0; Self::ENCODED_LEN];
26788 let mut buf = if avail_len < Self::ENCODED_LEN {
26789 payload_buf[0..avail_len].copy_from_slice(__input);
26790 Bytes::new(&payload_buf)
26791 } else {
26792 Bytes::new(__input)
26793 };
26794 let mut __struct = Self::default();
26795 __struct.baudrate = buf.get_u32_le();
26796 __struct.timeout = buf.get_u16_le();
26797 let tmp = buf.get_u8();
26798 __struct.device =
26799 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26800 enum_type: "SerialControlDev",
26801 value: tmp as u32,
26802 })?;
26803 let tmp = buf.get_u8();
26804 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
26805 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26806 flag_type: "SerialControlFlag",
26807 value: tmp as u32,
26808 })?;
26809 __struct.count = buf.get_u8();
26810 for v in &mut __struct.data {
26811 let val = buf.get_u8();
26812 *v = val;
26813 }
26814 __struct.target_system = buf.get_u8();
26815 __struct.target_component = buf.get_u8();
26816 Ok(__struct)
26817 }
26818 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26819 let mut __tmp = BytesMut::new(bytes);
26820 #[allow(clippy::absurd_extreme_comparisons)]
26821 #[allow(unused_comparisons)]
26822 if __tmp.remaining() < Self::ENCODED_LEN {
26823 panic!(
26824 "buffer is too small (need {} bytes, but got {})",
26825 Self::ENCODED_LEN,
26826 __tmp.remaining(),
26827 )
26828 }
26829 __tmp.put_u32_le(self.baudrate);
26830 __tmp.put_u16_le(self.timeout);
26831 __tmp.put_u8(self.device as u8);
26832 __tmp.put_u8(self.flags.bits());
26833 __tmp.put_u8(self.count);
26834 for val in &self.data {
26835 __tmp.put_u8(*val);
26836 }
26837 if matches!(version, MavlinkVersion::V2) {
26838 __tmp.put_u8(self.target_system);
26839 __tmp.put_u8(self.target_component);
26840 let len = __tmp.len();
26841 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26842 } else {
26843 __tmp.len()
26844 }
26845 }
26846}
26847#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
26848#[doc = ""]
26849#[doc = "ID: 36"]
26850#[derive(Debug, Clone, PartialEq)]
26851#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26853pub struct SERVO_OUTPUT_RAW_DATA {
26854 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26855 pub time_usec: u32,
26856 #[doc = "Servo output 1 value"]
26857 pub servo1_raw: u16,
26858 #[doc = "Servo output 2 value"]
26859 pub servo2_raw: u16,
26860 #[doc = "Servo output 3 value"]
26861 pub servo3_raw: u16,
26862 #[doc = "Servo output 4 value"]
26863 pub servo4_raw: u16,
26864 #[doc = "Servo output 5 value"]
26865 pub servo5_raw: u16,
26866 #[doc = "Servo output 6 value"]
26867 pub servo6_raw: u16,
26868 #[doc = "Servo output 7 value"]
26869 pub servo7_raw: u16,
26870 #[doc = "Servo output 8 value"]
26871 pub servo8_raw: u16,
26872 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26873 pub port: u8,
26874 #[doc = "Servo output 9 value"]
26875 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26876 pub servo9_raw: u16,
26877 #[doc = "Servo output 10 value"]
26878 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26879 pub servo10_raw: u16,
26880 #[doc = "Servo output 11 value"]
26881 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26882 pub servo11_raw: u16,
26883 #[doc = "Servo output 12 value"]
26884 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26885 pub servo12_raw: u16,
26886 #[doc = "Servo output 13 value"]
26887 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26888 pub servo13_raw: u16,
26889 #[doc = "Servo output 14 value"]
26890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26891 pub servo14_raw: u16,
26892 #[doc = "Servo output 15 value"]
26893 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26894 pub servo15_raw: u16,
26895 #[doc = "Servo output 16 value"]
26896 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26897 pub servo16_raw: u16,
26898}
26899impl SERVO_OUTPUT_RAW_DATA {
26900 pub const ENCODED_LEN: usize = 37usize;
26901 pub const DEFAULT: Self = Self {
26902 time_usec: 0_u32,
26903 servo1_raw: 0_u16,
26904 servo2_raw: 0_u16,
26905 servo3_raw: 0_u16,
26906 servo4_raw: 0_u16,
26907 servo5_raw: 0_u16,
26908 servo6_raw: 0_u16,
26909 servo7_raw: 0_u16,
26910 servo8_raw: 0_u16,
26911 port: 0_u8,
26912 servo9_raw: 0_u16,
26913 servo10_raw: 0_u16,
26914 servo11_raw: 0_u16,
26915 servo12_raw: 0_u16,
26916 servo13_raw: 0_u16,
26917 servo14_raw: 0_u16,
26918 servo15_raw: 0_u16,
26919 servo16_raw: 0_u16,
26920 };
26921 #[cfg(feature = "arbitrary")]
26922 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26923 use arbitrary::{Arbitrary, Unstructured};
26924 let mut buf = [0u8; 1024];
26925 rng.fill_bytes(&mut buf);
26926 let mut unstructured = Unstructured::new(&buf);
26927 Self::arbitrary(&mut unstructured).unwrap_or_default()
26928 }
26929}
26930impl Default for SERVO_OUTPUT_RAW_DATA {
26931 fn default() -> Self {
26932 Self::DEFAULT.clone()
26933 }
26934}
26935impl MessageData for SERVO_OUTPUT_RAW_DATA {
26936 type Message = MavMessage;
26937 const ID: u32 = 36u32;
26938 const NAME: &'static str = "SERVO_OUTPUT_RAW";
26939 const EXTRA_CRC: u8 = 222u8;
26940 const ENCODED_LEN: usize = 37usize;
26941 fn deser(
26942 _version: MavlinkVersion,
26943 __input: &[u8],
26944 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26945 let avail_len = __input.len();
26946 let mut payload_buf = [0; Self::ENCODED_LEN];
26947 let mut buf = if avail_len < Self::ENCODED_LEN {
26948 payload_buf[0..avail_len].copy_from_slice(__input);
26949 Bytes::new(&payload_buf)
26950 } else {
26951 Bytes::new(__input)
26952 };
26953 let mut __struct = Self::default();
26954 __struct.time_usec = buf.get_u32_le();
26955 __struct.servo1_raw = buf.get_u16_le();
26956 __struct.servo2_raw = buf.get_u16_le();
26957 __struct.servo3_raw = buf.get_u16_le();
26958 __struct.servo4_raw = buf.get_u16_le();
26959 __struct.servo5_raw = buf.get_u16_le();
26960 __struct.servo6_raw = buf.get_u16_le();
26961 __struct.servo7_raw = buf.get_u16_le();
26962 __struct.servo8_raw = buf.get_u16_le();
26963 __struct.port = buf.get_u8();
26964 __struct.servo9_raw = buf.get_u16_le();
26965 __struct.servo10_raw = buf.get_u16_le();
26966 __struct.servo11_raw = buf.get_u16_le();
26967 __struct.servo12_raw = buf.get_u16_le();
26968 __struct.servo13_raw = buf.get_u16_le();
26969 __struct.servo14_raw = buf.get_u16_le();
26970 __struct.servo15_raw = buf.get_u16_le();
26971 __struct.servo16_raw = buf.get_u16_le();
26972 Ok(__struct)
26973 }
26974 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26975 let mut __tmp = BytesMut::new(bytes);
26976 #[allow(clippy::absurd_extreme_comparisons)]
26977 #[allow(unused_comparisons)]
26978 if __tmp.remaining() < Self::ENCODED_LEN {
26979 panic!(
26980 "buffer is too small (need {} bytes, but got {})",
26981 Self::ENCODED_LEN,
26982 __tmp.remaining(),
26983 )
26984 }
26985 __tmp.put_u32_le(self.time_usec);
26986 __tmp.put_u16_le(self.servo1_raw);
26987 __tmp.put_u16_le(self.servo2_raw);
26988 __tmp.put_u16_le(self.servo3_raw);
26989 __tmp.put_u16_le(self.servo4_raw);
26990 __tmp.put_u16_le(self.servo5_raw);
26991 __tmp.put_u16_le(self.servo6_raw);
26992 __tmp.put_u16_le(self.servo7_raw);
26993 __tmp.put_u16_le(self.servo8_raw);
26994 __tmp.put_u8(self.port);
26995 if matches!(version, MavlinkVersion::V2) {
26996 __tmp.put_u16_le(self.servo9_raw);
26997 __tmp.put_u16_le(self.servo10_raw);
26998 __tmp.put_u16_le(self.servo11_raw);
26999 __tmp.put_u16_le(self.servo12_raw);
27000 __tmp.put_u16_le(self.servo13_raw);
27001 __tmp.put_u16_le(self.servo14_raw);
27002 __tmp.put_u16_le(self.servo15_raw);
27003 __tmp.put_u16_le(self.servo16_raw);
27004 let len = __tmp.len();
27005 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27006 } else {
27007 __tmp.len()
27008 }
27009 }
27010}
27011#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27012#[doc = ""]
27013#[doc = "ID: 256"]
27014#[derive(Debug, Clone, PartialEq)]
27015#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27016#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27017pub struct SETUP_SIGNING_DATA {
27018 #[doc = "initial timestamp"]
27019 pub initial_timestamp: u64,
27020 #[doc = "system id of the target"]
27021 pub target_system: u8,
27022 #[doc = "component ID of the target"]
27023 pub target_component: u8,
27024 #[doc = "signing key"]
27025 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27026 pub secret_key: [u8; 32],
27027}
27028impl SETUP_SIGNING_DATA {
27029 pub const ENCODED_LEN: usize = 42usize;
27030 pub const DEFAULT: Self = Self {
27031 initial_timestamp: 0_u64,
27032 target_system: 0_u8,
27033 target_component: 0_u8,
27034 secret_key: [0_u8; 32usize],
27035 };
27036 #[cfg(feature = "arbitrary")]
27037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27038 use arbitrary::{Arbitrary, Unstructured};
27039 let mut buf = [0u8; 1024];
27040 rng.fill_bytes(&mut buf);
27041 let mut unstructured = Unstructured::new(&buf);
27042 Self::arbitrary(&mut unstructured).unwrap_or_default()
27043 }
27044}
27045impl Default for SETUP_SIGNING_DATA {
27046 fn default() -> Self {
27047 Self::DEFAULT.clone()
27048 }
27049}
27050impl MessageData for SETUP_SIGNING_DATA {
27051 type Message = MavMessage;
27052 const ID: u32 = 256u32;
27053 const NAME: &'static str = "SETUP_SIGNING";
27054 const EXTRA_CRC: u8 = 71u8;
27055 const ENCODED_LEN: usize = 42usize;
27056 fn deser(
27057 _version: MavlinkVersion,
27058 __input: &[u8],
27059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27060 let avail_len = __input.len();
27061 let mut payload_buf = [0; Self::ENCODED_LEN];
27062 let mut buf = if avail_len < Self::ENCODED_LEN {
27063 payload_buf[0..avail_len].copy_from_slice(__input);
27064 Bytes::new(&payload_buf)
27065 } else {
27066 Bytes::new(__input)
27067 };
27068 let mut __struct = Self::default();
27069 __struct.initial_timestamp = buf.get_u64_le();
27070 __struct.target_system = buf.get_u8();
27071 __struct.target_component = buf.get_u8();
27072 for v in &mut __struct.secret_key {
27073 let val = buf.get_u8();
27074 *v = val;
27075 }
27076 Ok(__struct)
27077 }
27078 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27079 let mut __tmp = BytesMut::new(bytes);
27080 #[allow(clippy::absurd_extreme_comparisons)]
27081 #[allow(unused_comparisons)]
27082 if __tmp.remaining() < Self::ENCODED_LEN {
27083 panic!(
27084 "buffer is too small (need {} bytes, but got {})",
27085 Self::ENCODED_LEN,
27086 __tmp.remaining(),
27087 )
27088 }
27089 __tmp.put_u64_le(self.initial_timestamp);
27090 __tmp.put_u8(self.target_system);
27091 __tmp.put_u8(self.target_component);
27092 for val in &self.secret_key {
27093 __tmp.put_u8(*val);
27094 }
27095 if matches!(version, MavlinkVersion::V2) {
27096 let len = __tmp.len();
27097 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27098 } else {
27099 __tmp.len()
27100 }
27101 }
27102}
27103#[doc = "Set the vehicle attitude and body angular rates."]
27104#[doc = ""]
27105#[doc = "ID: 139"]
27106#[derive(Debug, Clone, PartialEq)]
27107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27109pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27110 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27111 pub time_usec: u64,
27112 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27113 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27114 pub controls: [f32; 8],
27115 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27116 pub group_mlx: u8,
27117 #[doc = "System ID"]
27118 pub target_system: u8,
27119 #[doc = "Component ID"]
27120 pub target_component: u8,
27121}
27122impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27123 pub const ENCODED_LEN: usize = 43usize;
27124 pub const DEFAULT: Self = Self {
27125 time_usec: 0_u64,
27126 controls: [0.0_f32; 8usize],
27127 group_mlx: 0_u8,
27128 target_system: 0_u8,
27129 target_component: 0_u8,
27130 };
27131 #[cfg(feature = "arbitrary")]
27132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27133 use arbitrary::{Arbitrary, Unstructured};
27134 let mut buf = [0u8; 1024];
27135 rng.fill_bytes(&mut buf);
27136 let mut unstructured = Unstructured::new(&buf);
27137 Self::arbitrary(&mut unstructured).unwrap_or_default()
27138 }
27139}
27140impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27141 fn default() -> Self {
27142 Self::DEFAULT.clone()
27143 }
27144}
27145impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27146 type Message = MavMessage;
27147 const ID: u32 = 139u32;
27148 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27149 const EXTRA_CRC: u8 = 168u8;
27150 const ENCODED_LEN: usize = 43usize;
27151 fn deser(
27152 _version: MavlinkVersion,
27153 __input: &[u8],
27154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27155 let avail_len = __input.len();
27156 let mut payload_buf = [0; Self::ENCODED_LEN];
27157 let mut buf = if avail_len < Self::ENCODED_LEN {
27158 payload_buf[0..avail_len].copy_from_slice(__input);
27159 Bytes::new(&payload_buf)
27160 } else {
27161 Bytes::new(__input)
27162 };
27163 let mut __struct = Self::default();
27164 __struct.time_usec = buf.get_u64_le();
27165 for v in &mut __struct.controls {
27166 let val = buf.get_f32_le();
27167 *v = val;
27168 }
27169 __struct.group_mlx = buf.get_u8();
27170 __struct.target_system = buf.get_u8();
27171 __struct.target_component = buf.get_u8();
27172 Ok(__struct)
27173 }
27174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27175 let mut __tmp = BytesMut::new(bytes);
27176 #[allow(clippy::absurd_extreme_comparisons)]
27177 #[allow(unused_comparisons)]
27178 if __tmp.remaining() < Self::ENCODED_LEN {
27179 panic!(
27180 "buffer is too small (need {} bytes, but got {})",
27181 Self::ENCODED_LEN,
27182 __tmp.remaining(),
27183 )
27184 }
27185 __tmp.put_u64_le(self.time_usec);
27186 for val in &self.controls {
27187 __tmp.put_f32_le(*val);
27188 }
27189 __tmp.put_u8(self.group_mlx);
27190 __tmp.put_u8(self.target_system);
27191 __tmp.put_u8(self.target_component);
27192 if matches!(version, MavlinkVersion::V2) {
27193 let len = __tmp.len();
27194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27195 } else {
27196 __tmp.len()
27197 }
27198 }
27199}
27200#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27201#[doc = ""]
27202#[doc = "ID: 82"]
27203#[derive(Debug, Clone, PartialEq)]
27204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27206pub struct SET_ATTITUDE_TARGET_DATA {
27207 #[doc = "Timestamp (time since system boot)."]
27208 pub time_boot_ms: u32,
27209 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27210 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27211 pub q: [f32; 4],
27212 #[doc = "Body roll rate"]
27213 pub body_roll_rate: f32,
27214 #[doc = "Body pitch rate"]
27215 pub body_pitch_rate: f32,
27216 #[doc = "Body yaw rate"]
27217 pub body_yaw_rate: f32,
27218 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27219 pub thrust: f32,
27220 #[doc = "System ID"]
27221 pub target_system: u8,
27222 #[doc = "Component ID"]
27223 pub target_component: u8,
27224 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27225 pub type_mask: AttitudeTargetTypemask,
27226 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27227 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27228 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27229 pub thrust_body: [f32; 3],
27230}
27231impl SET_ATTITUDE_TARGET_DATA {
27232 pub const ENCODED_LEN: usize = 51usize;
27233 pub const DEFAULT: Self = Self {
27234 time_boot_ms: 0_u32,
27235 q: [0.0_f32; 4usize],
27236 body_roll_rate: 0.0_f32,
27237 body_pitch_rate: 0.0_f32,
27238 body_yaw_rate: 0.0_f32,
27239 thrust: 0.0_f32,
27240 target_system: 0_u8,
27241 target_component: 0_u8,
27242 type_mask: AttitudeTargetTypemask::DEFAULT,
27243 thrust_body: [0.0_f32; 3usize],
27244 };
27245 #[cfg(feature = "arbitrary")]
27246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27247 use arbitrary::{Arbitrary, Unstructured};
27248 let mut buf = [0u8; 1024];
27249 rng.fill_bytes(&mut buf);
27250 let mut unstructured = Unstructured::new(&buf);
27251 Self::arbitrary(&mut unstructured).unwrap_or_default()
27252 }
27253}
27254impl Default for SET_ATTITUDE_TARGET_DATA {
27255 fn default() -> Self {
27256 Self::DEFAULT.clone()
27257 }
27258}
27259impl MessageData for SET_ATTITUDE_TARGET_DATA {
27260 type Message = MavMessage;
27261 const ID: u32 = 82u32;
27262 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27263 const EXTRA_CRC: u8 = 49u8;
27264 const ENCODED_LEN: usize = 51usize;
27265 fn deser(
27266 _version: MavlinkVersion,
27267 __input: &[u8],
27268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27269 let avail_len = __input.len();
27270 let mut payload_buf = [0; Self::ENCODED_LEN];
27271 let mut buf = if avail_len < Self::ENCODED_LEN {
27272 payload_buf[0..avail_len].copy_from_slice(__input);
27273 Bytes::new(&payload_buf)
27274 } else {
27275 Bytes::new(__input)
27276 };
27277 let mut __struct = Self::default();
27278 __struct.time_boot_ms = buf.get_u32_le();
27279 for v in &mut __struct.q {
27280 let val = buf.get_f32_le();
27281 *v = val;
27282 }
27283 __struct.body_roll_rate = buf.get_f32_le();
27284 __struct.body_pitch_rate = buf.get_f32_le();
27285 __struct.body_yaw_rate = buf.get_f32_le();
27286 __struct.thrust = buf.get_f32_le();
27287 __struct.target_system = buf.get_u8();
27288 __struct.target_component = buf.get_u8();
27289 let tmp = buf.get_u8();
27290 __struct.type_mask = AttitudeTargetTypemask::from_bits(
27291 tmp & AttitudeTargetTypemask::all().bits(),
27292 )
27293 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27294 flag_type: "AttitudeTargetTypemask",
27295 value: tmp as u32,
27296 })?;
27297 for v in &mut __struct.thrust_body {
27298 let val = buf.get_f32_le();
27299 *v = val;
27300 }
27301 Ok(__struct)
27302 }
27303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27304 let mut __tmp = BytesMut::new(bytes);
27305 #[allow(clippy::absurd_extreme_comparisons)]
27306 #[allow(unused_comparisons)]
27307 if __tmp.remaining() < Self::ENCODED_LEN {
27308 panic!(
27309 "buffer is too small (need {} bytes, but got {})",
27310 Self::ENCODED_LEN,
27311 __tmp.remaining(),
27312 )
27313 }
27314 __tmp.put_u32_le(self.time_boot_ms);
27315 for val in &self.q {
27316 __tmp.put_f32_le(*val);
27317 }
27318 __tmp.put_f32_le(self.body_roll_rate);
27319 __tmp.put_f32_le(self.body_pitch_rate);
27320 __tmp.put_f32_le(self.body_yaw_rate);
27321 __tmp.put_f32_le(self.thrust);
27322 __tmp.put_u8(self.target_system);
27323 __tmp.put_u8(self.target_component);
27324 __tmp.put_u8(self.type_mask.bits());
27325 if matches!(version, MavlinkVersion::V2) {
27326 for val in &self.thrust_body {
27327 __tmp.put_f32_le(*val);
27328 }
27329 let len = __tmp.len();
27330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27331 } else {
27332 __tmp.len()
27333 }
27334 }
27335}
27336#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27337#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27338#[doc = ""]
27339#[doc = "ID: 48"]
27340#[derive(Debug, Clone, PartialEq)]
27341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27343pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27344 #[doc = "Latitude (WGS84)"]
27345 pub latitude: i32,
27346 #[doc = "Longitude (WGS84)"]
27347 pub longitude: i32,
27348 #[doc = "Altitude (MSL). Positive for up."]
27349 pub altitude: i32,
27350 #[doc = "System ID"]
27351 pub target_system: u8,
27352 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27353 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27354 pub time_usec: u64,
27355}
27356impl SET_GPS_GLOBAL_ORIGIN_DATA {
27357 pub const ENCODED_LEN: usize = 21usize;
27358 pub const DEFAULT: Self = Self {
27359 latitude: 0_i32,
27360 longitude: 0_i32,
27361 altitude: 0_i32,
27362 target_system: 0_u8,
27363 time_usec: 0_u64,
27364 };
27365 #[cfg(feature = "arbitrary")]
27366 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27367 use arbitrary::{Arbitrary, Unstructured};
27368 let mut buf = [0u8; 1024];
27369 rng.fill_bytes(&mut buf);
27370 let mut unstructured = Unstructured::new(&buf);
27371 Self::arbitrary(&mut unstructured).unwrap_or_default()
27372 }
27373}
27374impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27375 fn default() -> Self {
27376 Self::DEFAULT.clone()
27377 }
27378}
27379impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27380 type Message = MavMessage;
27381 const ID: u32 = 48u32;
27382 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27383 const EXTRA_CRC: u8 = 41u8;
27384 const ENCODED_LEN: usize = 21usize;
27385 fn deser(
27386 _version: MavlinkVersion,
27387 __input: &[u8],
27388 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27389 let avail_len = __input.len();
27390 let mut payload_buf = [0; Self::ENCODED_LEN];
27391 let mut buf = if avail_len < Self::ENCODED_LEN {
27392 payload_buf[0..avail_len].copy_from_slice(__input);
27393 Bytes::new(&payload_buf)
27394 } else {
27395 Bytes::new(__input)
27396 };
27397 let mut __struct = Self::default();
27398 __struct.latitude = buf.get_i32_le();
27399 __struct.longitude = buf.get_i32_le();
27400 __struct.altitude = buf.get_i32_le();
27401 __struct.target_system = buf.get_u8();
27402 __struct.time_usec = buf.get_u64_le();
27403 Ok(__struct)
27404 }
27405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27406 let mut __tmp = BytesMut::new(bytes);
27407 #[allow(clippy::absurd_extreme_comparisons)]
27408 #[allow(unused_comparisons)]
27409 if __tmp.remaining() < Self::ENCODED_LEN {
27410 panic!(
27411 "buffer is too small (need {} bytes, but got {})",
27412 Self::ENCODED_LEN,
27413 __tmp.remaining(),
27414 )
27415 }
27416 __tmp.put_i32_le(self.latitude);
27417 __tmp.put_i32_le(self.longitude);
27418 __tmp.put_i32_le(self.altitude);
27419 __tmp.put_u8(self.target_system);
27420 if matches!(version, MavlinkVersion::V2) {
27421 __tmp.put_u64_le(self.time_usec);
27422 let len = __tmp.len();
27423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27424 } else {
27425 __tmp.len()
27426 }
27427 }
27428}
27429#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27430#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27431#[doc = ""]
27432#[doc = "ID: 243"]
27433#[derive(Debug, Clone, PartialEq)]
27434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27436pub struct SET_HOME_POSITION_DATA {
27437 #[doc = "Latitude (WGS84)"]
27438 pub latitude: i32,
27439 #[doc = "Longitude (WGS84)"]
27440 pub longitude: i32,
27441 #[doc = "Altitude (MSL). Positive for up."]
27442 pub altitude: i32,
27443 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27444 pub x: f32,
27445 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27446 pub y: f32,
27447 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27448 pub z: f32,
27449 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27451 pub q: [f32; 4],
27452 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27453 pub approach_x: f32,
27454 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27455 pub approach_y: f32,
27456 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27457 pub approach_z: f32,
27458 #[doc = "System ID."]
27459 pub target_system: u8,
27460 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27461 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27462 pub time_usec: u64,
27463}
27464impl SET_HOME_POSITION_DATA {
27465 pub const ENCODED_LEN: usize = 61usize;
27466 pub const DEFAULT: Self = Self {
27467 latitude: 0_i32,
27468 longitude: 0_i32,
27469 altitude: 0_i32,
27470 x: 0.0_f32,
27471 y: 0.0_f32,
27472 z: 0.0_f32,
27473 q: [0.0_f32; 4usize],
27474 approach_x: 0.0_f32,
27475 approach_y: 0.0_f32,
27476 approach_z: 0.0_f32,
27477 target_system: 0_u8,
27478 time_usec: 0_u64,
27479 };
27480 #[cfg(feature = "arbitrary")]
27481 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27482 use arbitrary::{Arbitrary, Unstructured};
27483 let mut buf = [0u8; 1024];
27484 rng.fill_bytes(&mut buf);
27485 let mut unstructured = Unstructured::new(&buf);
27486 Self::arbitrary(&mut unstructured).unwrap_or_default()
27487 }
27488}
27489impl Default for SET_HOME_POSITION_DATA {
27490 fn default() -> Self {
27491 Self::DEFAULT.clone()
27492 }
27493}
27494impl MessageData for SET_HOME_POSITION_DATA {
27495 type Message = MavMessage;
27496 const ID: u32 = 243u32;
27497 const NAME: &'static str = "SET_HOME_POSITION";
27498 const EXTRA_CRC: u8 = 85u8;
27499 const ENCODED_LEN: usize = 61usize;
27500 fn deser(
27501 _version: MavlinkVersion,
27502 __input: &[u8],
27503 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27504 let avail_len = __input.len();
27505 let mut payload_buf = [0; Self::ENCODED_LEN];
27506 let mut buf = if avail_len < Self::ENCODED_LEN {
27507 payload_buf[0..avail_len].copy_from_slice(__input);
27508 Bytes::new(&payload_buf)
27509 } else {
27510 Bytes::new(__input)
27511 };
27512 let mut __struct = Self::default();
27513 __struct.latitude = buf.get_i32_le();
27514 __struct.longitude = buf.get_i32_le();
27515 __struct.altitude = buf.get_i32_le();
27516 __struct.x = buf.get_f32_le();
27517 __struct.y = buf.get_f32_le();
27518 __struct.z = buf.get_f32_le();
27519 for v in &mut __struct.q {
27520 let val = buf.get_f32_le();
27521 *v = val;
27522 }
27523 __struct.approach_x = buf.get_f32_le();
27524 __struct.approach_y = buf.get_f32_le();
27525 __struct.approach_z = buf.get_f32_le();
27526 __struct.target_system = buf.get_u8();
27527 __struct.time_usec = buf.get_u64_le();
27528 Ok(__struct)
27529 }
27530 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27531 let mut __tmp = BytesMut::new(bytes);
27532 #[allow(clippy::absurd_extreme_comparisons)]
27533 #[allow(unused_comparisons)]
27534 if __tmp.remaining() < Self::ENCODED_LEN {
27535 panic!(
27536 "buffer is too small (need {} bytes, but got {})",
27537 Self::ENCODED_LEN,
27538 __tmp.remaining(),
27539 )
27540 }
27541 __tmp.put_i32_le(self.latitude);
27542 __tmp.put_i32_le(self.longitude);
27543 __tmp.put_i32_le(self.altitude);
27544 __tmp.put_f32_le(self.x);
27545 __tmp.put_f32_le(self.y);
27546 __tmp.put_f32_le(self.z);
27547 for val in &self.q {
27548 __tmp.put_f32_le(*val);
27549 }
27550 __tmp.put_f32_le(self.approach_x);
27551 __tmp.put_f32_le(self.approach_y);
27552 __tmp.put_f32_le(self.approach_z);
27553 __tmp.put_u8(self.target_system);
27554 if matches!(version, MavlinkVersion::V2) {
27555 __tmp.put_u64_le(self.time_usec);
27556 let len = __tmp.len();
27557 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27558 } else {
27559 __tmp.len()
27560 }
27561 }
27562}
27563#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27564#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27565#[doc = ""]
27566#[doc = "ID: 11"]
27567#[derive(Debug, Clone, PartialEq)]
27568#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27570pub struct SET_MODE_DATA {
27571 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27572 pub custom_mode: u32,
27573 #[doc = "The system setting the mode"]
27574 pub target_system: u8,
27575 #[doc = "The new base mode."]
27576 pub base_mode: MavMode,
27577}
27578impl SET_MODE_DATA {
27579 pub const ENCODED_LEN: usize = 6usize;
27580 pub const DEFAULT: Self = Self {
27581 custom_mode: 0_u32,
27582 target_system: 0_u8,
27583 base_mode: MavMode::DEFAULT,
27584 };
27585 #[cfg(feature = "arbitrary")]
27586 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27587 use arbitrary::{Arbitrary, Unstructured};
27588 let mut buf = [0u8; 1024];
27589 rng.fill_bytes(&mut buf);
27590 let mut unstructured = Unstructured::new(&buf);
27591 Self::arbitrary(&mut unstructured).unwrap_or_default()
27592 }
27593}
27594impl Default for SET_MODE_DATA {
27595 fn default() -> Self {
27596 Self::DEFAULT.clone()
27597 }
27598}
27599impl MessageData for SET_MODE_DATA {
27600 type Message = MavMessage;
27601 const ID: u32 = 11u32;
27602 const NAME: &'static str = "SET_MODE";
27603 const EXTRA_CRC: u8 = 89u8;
27604 const ENCODED_LEN: usize = 6usize;
27605 fn deser(
27606 _version: MavlinkVersion,
27607 __input: &[u8],
27608 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27609 let avail_len = __input.len();
27610 let mut payload_buf = [0; Self::ENCODED_LEN];
27611 let mut buf = if avail_len < Self::ENCODED_LEN {
27612 payload_buf[0..avail_len].copy_from_slice(__input);
27613 Bytes::new(&payload_buf)
27614 } else {
27615 Bytes::new(__input)
27616 };
27617 let mut __struct = Self::default();
27618 __struct.custom_mode = buf.get_u32_le();
27619 __struct.target_system = buf.get_u8();
27620 let tmp = buf.get_u8();
27621 __struct.base_mode =
27622 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27623 enum_type: "MavMode",
27624 value: tmp as u32,
27625 })?;
27626 Ok(__struct)
27627 }
27628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27629 let mut __tmp = BytesMut::new(bytes);
27630 #[allow(clippy::absurd_extreme_comparisons)]
27631 #[allow(unused_comparisons)]
27632 if __tmp.remaining() < Self::ENCODED_LEN {
27633 panic!(
27634 "buffer is too small (need {} bytes, but got {})",
27635 Self::ENCODED_LEN,
27636 __tmp.remaining(),
27637 )
27638 }
27639 __tmp.put_u32_le(self.custom_mode);
27640 __tmp.put_u8(self.target_system);
27641 __tmp.put_u8(self.base_mode as u8);
27642 if matches!(version, MavlinkVersion::V2) {
27643 let len = __tmp.len();
27644 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27645 } else {
27646 __tmp.len()
27647 }
27648 }
27649}
27650#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27651#[doc = ""]
27652#[doc = "ID: 86"]
27653#[derive(Debug, Clone, PartialEq)]
27654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27656pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27657 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27658 pub time_boot_ms: u32,
27659 #[doc = "Latitude in WGS84 frame"]
27660 pub lat_int: i32,
27661 #[doc = "Longitude in WGS84 frame"]
27662 pub lon_int: i32,
27663 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27664 pub alt: f32,
27665 #[doc = "X velocity in NED frame"]
27666 pub vx: f32,
27667 #[doc = "Y velocity in NED frame"]
27668 pub vy: f32,
27669 #[doc = "Z velocity in NED frame"]
27670 pub vz: f32,
27671 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27672 pub afx: f32,
27673 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27674 pub afy: f32,
27675 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27676 pub afz: f32,
27677 #[doc = "yaw setpoint"]
27678 pub yaw: f32,
27679 #[doc = "yaw rate setpoint"]
27680 pub yaw_rate: f32,
27681 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27682 pub type_mask: PositionTargetTypemask,
27683 #[doc = "System ID"]
27684 pub target_system: u8,
27685 #[doc = "Component ID"]
27686 pub target_component: u8,
27687 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
27688 pub coordinate_frame: MavFrame,
27689}
27690impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
27691 pub const ENCODED_LEN: usize = 53usize;
27692 pub const DEFAULT: Self = Self {
27693 time_boot_ms: 0_u32,
27694 lat_int: 0_i32,
27695 lon_int: 0_i32,
27696 alt: 0.0_f32,
27697 vx: 0.0_f32,
27698 vy: 0.0_f32,
27699 vz: 0.0_f32,
27700 afx: 0.0_f32,
27701 afy: 0.0_f32,
27702 afz: 0.0_f32,
27703 yaw: 0.0_f32,
27704 yaw_rate: 0.0_f32,
27705 type_mask: PositionTargetTypemask::DEFAULT,
27706 target_system: 0_u8,
27707 target_component: 0_u8,
27708 coordinate_frame: MavFrame::DEFAULT,
27709 };
27710 #[cfg(feature = "arbitrary")]
27711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27712 use arbitrary::{Arbitrary, Unstructured};
27713 let mut buf = [0u8; 1024];
27714 rng.fill_bytes(&mut buf);
27715 let mut unstructured = Unstructured::new(&buf);
27716 Self::arbitrary(&mut unstructured).unwrap_or_default()
27717 }
27718}
27719impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27720 fn default() -> Self {
27721 Self::DEFAULT.clone()
27722 }
27723}
27724impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27725 type Message = MavMessage;
27726 const ID: u32 = 86u32;
27727 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
27728 const EXTRA_CRC: u8 = 5u8;
27729 const ENCODED_LEN: usize = 53usize;
27730 fn deser(
27731 _version: MavlinkVersion,
27732 __input: &[u8],
27733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27734 let avail_len = __input.len();
27735 let mut payload_buf = [0; Self::ENCODED_LEN];
27736 let mut buf = if avail_len < Self::ENCODED_LEN {
27737 payload_buf[0..avail_len].copy_from_slice(__input);
27738 Bytes::new(&payload_buf)
27739 } else {
27740 Bytes::new(__input)
27741 };
27742 let mut __struct = Self::default();
27743 __struct.time_boot_ms = buf.get_u32_le();
27744 __struct.lat_int = buf.get_i32_le();
27745 __struct.lon_int = buf.get_i32_le();
27746 __struct.alt = buf.get_f32_le();
27747 __struct.vx = buf.get_f32_le();
27748 __struct.vy = buf.get_f32_le();
27749 __struct.vz = buf.get_f32_le();
27750 __struct.afx = buf.get_f32_le();
27751 __struct.afy = buf.get_f32_le();
27752 __struct.afz = buf.get_f32_le();
27753 __struct.yaw = buf.get_f32_le();
27754 __struct.yaw_rate = buf.get_f32_le();
27755 let tmp = buf.get_u16_le();
27756 __struct.type_mask = PositionTargetTypemask::from_bits(
27757 tmp & PositionTargetTypemask::all().bits(),
27758 )
27759 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27760 flag_type: "PositionTargetTypemask",
27761 value: tmp as u32,
27762 })?;
27763 __struct.target_system = buf.get_u8();
27764 __struct.target_component = buf.get_u8();
27765 let tmp = buf.get_u8();
27766 __struct.coordinate_frame =
27767 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27768 enum_type: "MavFrame",
27769 value: tmp as u32,
27770 })?;
27771 Ok(__struct)
27772 }
27773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27774 let mut __tmp = BytesMut::new(bytes);
27775 #[allow(clippy::absurd_extreme_comparisons)]
27776 #[allow(unused_comparisons)]
27777 if __tmp.remaining() < Self::ENCODED_LEN {
27778 panic!(
27779 "buffer is too small (need {} bytes, but got {})",
27780 Self::ENCODED_LEN,
27781 __tmp.remaining(),
27782 )
27783 }
27784 __tmp.put_u32_le(self.time_boot_ms);
27785 __tmp.put_i32_le(self.lat_int);
27786 __tmp.put_i32_le(self.lon_int);
27787 __tmp.put_f32_le(self.alt);
27788 __tmp.put_f32_le(self.vx);
27789 __tmp.put_f32_le(self.vy);
27790 __tmp.put_f32_le(self.vz);
27791 __tmp.put_f32_le(self.afx);
27792 __tmp.put_f32_le(self.afy);
27793 __tmp.put_f32_le(self.afz);
27794 __tmp.put_f32_le(self.yaw);
27795 __tmp.put_f32_le(self.yaw_rate);
27796 __tmp.put_u16_le(self.type_mask.bits());
27797 __tmp.put_u8(self.target_system);
27798 __tmp.put_u8(self.target_component);
27799 __tmp.put_u8(self.coordinate_frame as u8);
27800 if matches!(version, MavlinkVersion::V2) {
27801 let len = __tmp.len();
27802 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27803 } else {
27804 __tmp.len()
27805 }
27806 }
27807}
27808#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
27809#[doc = ""]
27810#[doc = "ID: 84"]
27811#[derive(Debug, Clone, PartialEq)]
27812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27814pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
27815 #[doc = "Timestamp (time since system boot)."]
27816 pub time_boot_ms: u32,
27817 #[doc = "X Position in NED frame"]
27818 pub x: f32,
27819 #[doc = "Y Position in NED frame"]
27820 pub y: f32,
27821 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
27822 pub z: f32,
27823 #[doc = "X velocity in NED frame"]
27824 pub vx: f32,
27825 #[doc = "Y velocity in NED frame"]
27826 pub vy: f32,
27827 #[doc = "Z velocity in NED frame"]
27828 pub vz: f32,
27829 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27830 pub afx: f32,
27831 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27832 pub afy: f32,
27833 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27834 pub afz: f32,
27835 #[doc = "yaw setpoint"]
27836 pub yaw: f32,
27837 #[doc = "yaw rate setpoint"]
27838 pub yaw_rate: f32,
27839 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27840 pub type_mask: PositionTargetTypemask,
27841 #[doc = "System ID"]
27842 pub target_system: u8,
27843 #[doc = "Component ID"]
27844 pub target_component: u8,
27845 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
27846 pub coordinate_frame: MavFrame,
27847}
27848impl SET_POSITION_TARGET_LOCAL_NED_DATA {
27849 pub const ENCODED_LEN: usize = 53usize;
27850 pub const DEFAULT: Self = Self {
27851 time_boot_ms: 0_u32,
27852 x: 0.0_f32,
27853 y: 0.0_f32,
27854 z: 0.0_f32,
27855 vx: 0.0_f32,
27856 vy: 0.0_f32,
27857 vz: 0.0_f32,
27858 afx: 0.0_f32,
27859 afy: 0.0_f32,
27860 afz: 0.0_f32,
27861 yaw: 0.0_f32,
27862 yaw_rate: 0.0_f32,
27863 type_mask: PositionTargetTypemask::DEFAULT,
27864 target_system: 0_u8,
27865 target_component: 0_u8,
27866 coordinate_frame: MavFrame::DEFAULT,
27867 };
27868 #[cfg(feature = "arbitrary")]
27869 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27870 use arbitrary::{Arbitrary, Unstructured};
27871 let mut buf = [0u8; 1024];
27872 rng.fill_bytes(&mut buf);
27873 let mut unstructured = Unstructured::new(&buf);
27874 Self::arbitrary(&mut unstructured).unwrap_or_default()
27875 }
27876}
27877impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
27878 fn default() -> Self {
27879 Self::DEFAULT.clone()
27880 }
27881}
27882impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
27883 type Message = MavMessage;
27884 const ID: u32 = 84u32;
27885 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
27886 const EXTRA_CRC: u8 = 143u8;
27887 const ENCODED_LEN: usize = 53usize;
27888 fn deser(
27889 _version: MavlinkVersion,
27890 __input: &[u8],
27891 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27892 let avail_len = __input.len();
27893 let mut payload_buf = [0; Self::ENCODED_LEN];
27894 let mut buf = if avail_len < Self::ENCODED_LEN {
27895 payload_buf[0..avail_len].copy_from_slice(__input);
27896 Bytes::new(&payload_buf)
27897 } else {
27898 Bytes::new(__input)
27899 };
27900 let mut __struct = Self::default();
27901 __struct.time_boot_ms = buf.get_u32_le();
27902 __struct.x = buf.get_f32_le();
27903 __struct.y = buf.get_f32_le();
27904 __struct.z = buf.get_f32_le();
27905 __struct.vx = buf.get_f32_le();
27906 __struct.vy = buf.get_f32_le();
27907 __struct.vz = buf.get_f32_le();
27908 __struct.afx = buf.get_f32_le();
27909 __struct.afy = buf.get_f32_le();
27910 __struct.afz = buf.get_f32_le();
27911 __struct.yaw = buf.get_f32_le();
27912 __struct.yaw_rate = buf.get_f32_le();
27913 let tmp = buf.get_u16_le();
27914 __struct.type_mask = PositionTargetTypemask::from_bits(
27915 tmp & PositionTargetTypemask::all().bits(),
27916 )
27917 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27918 flag_type: "PositionTargetTypemask",
27919 value: tmp as u32,
27920 })?;
27921 __struct.target_system = buf.get_u8();
27922 __struct.target_component = buf.get_u8();
27923 let tmp = buf.get_u8();
27924 __struct.coordinate_frame =
27925 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27926 enum_type: "MavFrame",
27927 value: tmp as u32,
27928 })?;
27929 Ok(__struct)
27930 }
27931 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27932 let mut __tmp = BytesMut::new(bytes);
27933 #[allow(clippy::absurd_extreme_comparisons)]
27934 #[allow(unused_comparisons)]
27935 if __tmp.remaining() < Self::ENCODED_LEN {
27936 panic!(
27937 "buffer is too small (need {} bytes, but got {})",
27938 Self::ENCODED_LEN,
27939 __tmp.remaining(),
27940 )
27941 }
27942 __tmp.put_u32_le(self.time_boot_ms);
27943 __tmp.put_f32_le(self.x);
27944 __tmp.put_f32_le(self.y);
27945 __tmp.put_f32_le(self.z);
27946 __tmp.put_f32_le(self.vx);
27947 __tmp.put_f32_le(self.vy);
27948 __tmp.put_f32_le(self.vz);
27949 __tmp.put_f32_le(self.afx);
27950 __tmp.put_f32_le(self.afy);
27951 __tmp.put_f32_le(self.afz);
27952 __tmp.put_f32_le(self.yaw);
27953 __tmp.put_f32_le(self.yaw_rate);
27954 __tmp.put_u16_le(self.type_mask.bits());
27955 __tmp.put_u8(self.target_system);
27956 __tmp.put_u8(self.target_component);
27957 __tmp.put_u8(self.coordinate_frame as u8);
27958 if matches!(version, MavlinkVersion::V2) {
27959 let len = __tmp.len();
27960 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27961 } else {
27962 __tmp.len()
27963 }
27964 }
27965}
27966#[doc = "Status of simulation environment, if used."]
27967#[doc = ""]
27968#[doc = "ID: 108"]
27969#[derive(Debug, Clone, PartialEq)]
27970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27971#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27972pub struct SIM_STATE_DATA {
27973 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
27974 pub q1: f32,
27975 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
27976 pub q2: f32,
27977 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
27978 pub q3: f32,
27979 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
27980 pub q4: f32,
27981 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
27982 pub roll: f32,
27983 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
27984 pub pitch: f32,
27985 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
27986 pub yaw: f32,
27987 #[doc = "X acceleration"]
27988 pub xacc: f32,
27989 #[doc = "Y acceleration"]
27990 pub yacc: f32,
27991 #[doc = "Z acceleration"]
27992 pub zacc: f32,
27993 #[doc = "Angular speed around X axis"]
27994 pub xgyro: f32,
27995 #[doc = "Angular speed around Y axis"]
27996 pub ygyro: f32,
27997 #[doc = "Angular speed around Z axis"]
27998 pub zgyro: f32,
27999 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28000 pub lat: f32,
28001 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28002 pub lon: f32,
28003 #[doc = "Altitude"]
28004 pub alt: f32,
28005 #[doc = "Horizontal position standard deviation"]
28006 pub std_dev_horz: f32,
28007 #[doc = "Vertical position standard deviation"]
28008 pub std_dev_vert: f32,
28009 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28010 pub vn: f32,
28011 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28012 pub ve: f32,
28013 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28014 pub vd: f32,
28015 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28016 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28017 pub lat_int: i32,
28018 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28019 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28020 pub lon_int: i32,
28021}
28022impl SIM_STATE_DATA {
28023 pub const ENCODED_LEN: usize = 92usize;
28024 pub const DEFAULT: Self = Self {
28025 q1: 0.0_f32,
28026 q2: 0.0_f32,
28027 q3: 0.0_f32,
28028 q4: 0.0_f32,
28029 roll: 0.0_f32,
28030 pitch: 0.0_f32,
28031 yaw: 0.0_f32,
28032 xacc: 0.0_f32,
28033 yacc: 0.0_f32,
28034 zacc: 0.0_f32,
28035 xgyro: 0.0_f32,
28036 ygyro: 0.0_f32,
28037 zgyro: 0.0_f32,
28038 lat: 0.0_f32,
28039 lon: 0.0_f32,
28040 alt: 0.0_f32,
28041 std_dev_horz: 0.0_f32,
28042 std_dev_vert: 0.0_f32,
28043 vn: 0.0_f32,
28044 ve: 0.0_f32,
28045 vd: 0.0_f32,
28046 lat_int: 0_i32,
28047 lon_int: 0_i32,
28048 };
28049 #[cfg(feature = "arbitrary")]
28050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28051 use arbitrary::{Arbitrary, Unstructured};
28052 let mut buf = [0u8; 1024];
28053 rng.fill_bytes(&mut buf);
28054 let mut unstructured = Unstructured::new(&buf);
28055 Self::arbitrary(&mut unstructured).unwrap_or_default()
28056 }
28057}
28058impl Default for SIM_STATE_DATA {
28059 fn default() -> Self {
28060 Self::DEFAULT.clone()
28061 }
28062}
28063impl MessageData for SIM_STATE_DATA {
28064 type Message = MavMessage;
28065 const ID: u32 = 108u32;
28066 const NAME: &'static str = "SIM_STATE";
28067 const EXTRA_CRC: u8 = 32u8;
28068 const ENCODED_LEN: usize = 92usize;
28069 fn deser(
28070 _version: MavlinkVersion,
28071 __input: &[u8],
28072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28073 let avail_len = __input.len();
28074 let mut payload_buf = [0; Self::ENCODED_LEN];
28075 let mut buf = if avail_len < Self::ENCODED_LEN {
28076 payload_buf[0..avail_len].copy_from_slice(__input);
28077 Bytes::new(&payload_buf)
28078 } else {
28079 Bytes::new(__input)
28080 };
28081 let mut __struct = Self::default();
28082 __struct.q1 = buf.get_f32_le();
28083 __struct.q2 = buf.get_f32_le();
28084 __struct.q3 = buf.get_f32_le();
28085 __struct.q4 = buf.get_f32_le();
28086 __struct.roll = buf.get_f32_le();
28087 __struct.pitch = buf.get_f32_le();
28088 __struct.yaw = buf.get_f32_le();
28089 __struct.xacc = buf.get_f32_le();
28090 __struct.yacc = buf.get_f32_le();
28091 __struct.zacc = buf.get_f32_le();
28092 __struct.xgyro = buf.get_f32_le();
28093 __struct.ygyro = buf.get_f32_le();
28094 __struct.zgyro = buf.get_f32_le();
28095 __struct.lat = buf.get_f32_le();
28096 __struct.lon = buf.get_f32_le();
28097 __struct.alt = buf.get_f32_le();
28098 __struct.std_dev_horz = buf.get_f32_le();
28099 __struct.std_dev_vert = buf.get_f32_le();
28100 __struct.vn = buf.get_f32_le();
28101 __struct.ve = buf.get_f32_le();
28102 __struct.vd = buf.get_f32_le();
28103 __struct.lat_int = buf.get_i32_le();
28104 __struct.lon_int = buf.get_i32_le();
28105 Ok(__struct)
28106 }
28107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28108 let mut __tmp = BytesMut::new(bytes);
28109 #[allow(clippy::absurd_extreme_comparisons)]
28110 #[allow(unused_comparisons)]
28111 if __tmp.remaining() < Self::ENCODED_LEN {
28112 panic!(
28113 "buffer is too small (need {} bytes, but got {})",
28114 Self::ENCODED_LEN,
28115 __tmp.remaining(),
28116 )
28117 }
28118 __tmp.put_f32_le(self.q1);
28119 __tmp.put_f32_le(self.q2);
28120 __tmp.put_f32_le(self.q3);
28121 __tmp.put_f32_le(self.q4);
28122 __tmp.put_f32_le(self.roll);
28123 __tmp.put_f32_le(self.pitch);
28124 __tmp.put_f32_le(self.yaw);
28125 __tmp.put_f32_le(self.xacc);
28126 __tmp.put_f32_le(self.yacc);
28127 __tmp.put_f32_le(self.zacc);
28128 __tmp.put_f32_le(self.xgyro);
28129 __tmp.put_f32_le(self.ygyro);
28130 __tmp.put_f32_le(self.zgyro);
28131 __tmp.put_f32_le(self.lat);
28132 __tmp.put_f32_le(self.lon);
28133 __tmp.put_f32_le(self.alt);
28134 __tmp.put_f32_le(self.std_dev_horz);
28135 __tmp.put_f32_le(self.std_dev_vert);
28136 __tmp.put_f32_le(self.vn);
28137 __tmp.put_f32_le(self.ve);
28138 __tmp.put_f32_le(self.vd);
28139 if matches!(version, MavlinkVersion::V2) {
28140 __tmp.put_i32_le(self.lat_int);
28141 __tmp.put_i32_le(self.lon_int);
28142 let len = __tmp.len();
28143 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28144 } else {
28145 __tmp.len()
28146 }
28147 }
28148}
28149#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28150#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28151#[doc = ""]
28152#[doc = "ID: 370"]
28153#[derive(Debug, Clone, PartialEq)]
28154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28156pub struct SMART_BATTERY_INFO_DATA {
28157 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28158 pub capacity_full_specification: i32,
28159 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28160 pub capacity_full: i32,
28161 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28162 pub cycle_count: u16,
28163 #[doc = "Battery weight. 0: field not provided."]
28164 pub weight: u16,
28165 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28166 pub discharge_minimum_voltage: u16,
28167 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28168 pub charging_minimum_voltage: u16,
28169 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28170 pub resting_minimum_voltage: u16,
28171 #[doc = "Battery ID"]
28172 pub id: u8,
28173 #[doc = "Function of the battery"]
28174 pub battery_function: MavBatteryFunction,
28175 #[doc = "Type (chemistry) of the battery"]
28176 pub mavtype: MavBatteryType,
28177 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28178 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28179 pub serial_number: [u8; 16],
28180 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28181 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28182 pub device_name: [u8; 50],
28183 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28184 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28185 pub charging_maximum_voltage: u16,
28186 #[doc = "Number of battery cells in series. 0: field not provided."]
28187 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28188 pub cells_in_series: u8,
28189 #[doc = "Maximum pack discharge current. 0: field not provided."]
28190 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28191 pub discharge_maximum_current: u32,
28192 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28193 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28194 pub discharge_maximum_burst_current: u32,
28195 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28196 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28197 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28198 pub manufacture_date: [u8; 11],
28199}
28200impl SMART_BATTERY_INFO_DATA {
28201 pub const ENCODED_LEN: usize = 109usize;
28202 pub const DEFAULT: Self = Self {
28203 capacity_full_specification: 0_i32,
28204 capacity_full: 0_i32,
28205 cycle_count: 0_u16,
28206 weight: 0_u16,
28207 discharge_minimum_voltage: 0_u16,
28208 charging_minimum_voltage: 0_u16,
28209 resting_minimum_voltage: 0_u16,
28210 id: 0_u8,
28211 battery_function: MavBatteryFunction::DEFAULT,
28212 mavtype: MavBatteryType::DEFAULT,
28213 serial_number: [0_u8; 16usize],
28214 device_name: [0_u8; 50usize],
28215 charging_maximum_voltage: 0_u16,
28216 cells_in_series: 0_u8,
28217 discharge_maximum_current: 0_u32,
28218 discharge_maximum_burst_current: 0_u32,
28219 manufacture_date: [0_u8; 11usize],
28220 };
28221 #[cfg(feature = "arbitrary")]
28222 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28223 use arbitrary::{Arbitrary, Unstructured};
28224 let mut buf = [0u8; 1024];
28225 rng.fill_bytes(&mut buf);
28226 let mut unstructured = Unstructured::new(&buf);
28227 Self::arbitrary(&mut unstructured).unwrap_or_default()
28228 }
28229}
28230impl Default for SMART_BATTERY_INFO_DATA {
28231 fn default() -> Self {
28232 Self::DEFAULT.clone()
28233 }
28234}
28235impl MessageData for SMART_BATTERY_INFO_DATA {
28236 type Message = MavMessage;
28237 const ID: u32 = 370u32;
28238 const NAME: &'static str = "SMART_BATTERY_INFO";
28239 const EXTRA_CRC: u8 = 75u8;
28240 const ENCODED_LEN: usize = 109usize;
28241 fn deser(
28242 _version: MavlinkVersion,
28243 __input: &[u8],
28244 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28245 let avail_len = __input.len();
28246 let mut payload_buf = [0; Self::ENCODED_LEN];
28247 let mut buf = if avail_len < Self::ENCODED_LEN {
28248 payload_buf[0..avail_len].copy_from_slice(__input);
28249 Bytes::new(&payload_buf)
28250 } else {
28251 Bytes::new(__input)
28252 };
28253 let mut __struct = Self::default();
28254 __struct.capacity_full_specification = buf.get_i32_le();
28255 __struct.capacity_full = buf.get_i32_le();
28256 __struct.cycle_count = buf.get_u16_le();
28257 __struct.weight = buf.get_u16_le();
28258 __struct.discharge_minimum_voltage = buf.get_u16_le();
28259 __struct.charging_minimum_voltage = buf.get_u16_le();
28260 __struct.resting_minimum_voltage = buf.get_u16_le();
28261 __struct.id = buf.get_u8();
28262 let tmp = buf.get_u8();
28263 __struct.battery_function =
28264 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28265 enum_type: "MavBatteryFunction",
28266 value: tmp as u32,
28267 })?;
28268 let tmp = buf.get_u8();
28269 __struct.mavtype =
28270 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28271 enum_type: "MavBatteryType",
28272 value: tmp as u32,
28273 })?;
28274 for v in &mut __struct.serial_number {
28275 let val = buf.get_u8();
28276 *v = val;
28277 }
28278 for v in &mut __struct.device_name {
28279 let val = buf.get_u8();
28280 *v = val;
28281 }
28282 __struct.charging_maximum_voltage = buf.get_u16_le();
28283 __struct.cells_in_series = buf.get_u8();
28284 __struct.discharge_maximum_current = buf.get_u32_le();
28285 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28286 for v in &mut __struct.manufacture_date {
28287 let val = buf.get_u8();
28288 *v = val;
28289 }
28290 Ok(__struct)
28291 }
28292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28293 let mut __tmp = BytesMut::new(bytes);
28294 #[allow(clippy::absurd_extreme_comparisons)]
28295 #[allow(unused_comparisons)]
28296 if __tmp.remaining() < Self::ENCODED_LEN {
28297 panic!(
28298 "buffer is too small (need {} bytes, but got {})",
28299 Self::ENCODED_LEN,
28300 __tmp.remaining(),
28301 )
28302 }
28303 __tmp.put_i32_le(self.capacity_full_specification);
28304 __tmp.put_i32_le(self.capacity_full);
28305 __tmp.put_u16_le(self.cycle_count);
28306 __tmp.put_u16_le(self.weight);
28307 __tmp.put_u16_le(self.discharge_minimum_voltage);
28308 __tmp.put_u16_le(self.charging_minimum_voltage);
28309 __tmp.put_u16_le(self.resting_minimum_voltage);
28310 __tmp.put_u8(self.id);
28311 __tmp.put_u8(self.battery_function as u8);
28312 __tmp.put_u8(self.mavtype as u8);
28313 for val in &self.serial_number {
28314 __tmp.put_u8(*val);
28315 }
28316 for val in &self.device_name {
28317 __tmp.put_u8(*val);
28318 }
28319 if matches!(version, MavlinkVersion::V2) {
28320 __tmp.put_u16_le(self.charging_maximum_voltage);
28321 __tmp.put_u8(self.cells_in_series);
28322 __tmp.put_u32_le(self.discharge_maximum_current);
28323 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28324 for val in &self.manufacture_date {
28325 __tmp.put_u8(*val);
28326 }
28327 let len = __tmp.len();
28328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28329 } else {
28330 __tmp.len()
28331 }
28332 }
28333}
28334#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28335#[doc = ""]
28336#[doc = "ID: 253"]
28337#[derive(Debug, Clone, PartialEq)]
28338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28340pub struct STATUSTEXT_DATA {
28341 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28342 pub severity: MavSeverity,
28343 #[doc = "Status text message, without null termination character"]
28344 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28345 pub text: [u8; 50],
28346 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28347 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28348 pub id: u16,
28349 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28350 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28351 pub chunk_seq: u8,
28352}
28353impl STATUSTEXT_DATA {
28354 pub const ENCODED_LEN: usize = 54usize;
28355 pub const DEFAULT: Self = Self {
28356 severity: MavSeverity::DEFAULT,
28357 text: [0_u8; 50usize],
28358 id: 0_u16,
28359 chunk_seq: 0_u8,
28360 };
28361 #[cfg(feature = "arbitrary")]
28362 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28363 use arbitrary::{Arbitrary, Unstructured};
28364 let mut buf = [0u8; 1024];
28365 rng.fill_bytes(&mut buf);
28366 let mut unstructured = Unstructured::new(&buf);
28367 Self::arbitrary(&mut unstructured).unwrap_or_default()
28368 }
28369}
28370impl Default for STATUSTEXT_DATA {
28371 fn default() -> Self {
28372 Self::DEFAULT.clone()
28373 }
28374}
28375impl MessageData for STATUSTEXT_DATA {
28376 type Message = MavMessage;
28377 const ID: u32 = 253u32;
28378 const NAME: &'static str = "STATUSTEXT";
28379 const EXTRA_CRC: u8 = 83u8;
28380 const ENCODED_LEN: usize = 54usize;
28381 fn deser(
28382 _version: MavlinkVersion,
28383 __input: &[u8],
28384 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28385 let avail_len = __input.len();
28386 let mut payload_buf = [0; Self::ENCODED_LEN];
28387 let mut buf = if avail_len < Self::ENCODED_LEN {
28388 payload_buf[0..avail_len].copy_from_slice(__input);
28389 Bytes::new(&payload_buf)
28390 } else {
28391 Bytes::new(__input)
28392 };
28393 let mut __struct = Self::default();
28394 let tmp = buf.get_u8();
28395 __struct.severity =
28396 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28397 enum_type: "MavSeverity",
28398 value: tmp as u32,
28399 })?;
28400 for v in &mut __struct.text {
28401 let val = buf.get_u8();
28402 *v = val;
28403 }
28404 __struct.id = buf.get_u16_le();
28405 __struct.chunk_seq = buf.get_u8();
28406 Ok(__struct)
28407 }
28408 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28409 let mut __tmp = BytesMut::new(bytes);
28410 #[allow(clippy::absurd_extreme_comparisons)]
28411 #[allow(unused_comparisons)]
28412 if __tmp.remaining() < Self::ENCODED_LEN {
28413 panic!(
28414 "buffer is too small (need {} bytes, but got {})",
28415 Self::ENCODED_LEN,
28416 __tmp.remaining(),
28417 )
28418 }
28419 __tmp.put_u8(self.severity as u8);
28420 for val in &self.text {
28421 __tmp.put_u8(*val);
28422 }
28423 if matches!(version, MavlinkVersion::V2) {
28424 __tmp.put_u16_le(self.id);
28425 __tmp.put_u8(self.chunk_seq);
28426 let len = __tmp.len();
28427 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28428 } else {
28429 __tmp.len()
28430 }
28431 }
28432}
28433#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28434#[doc = ""]
28435#[doc = "ID: 261"]
28436#[derive(Debug, Clone, PartialEq)]
28437#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28439pub struct STORAGE_INFORMATION_DATA {
28440 #[doc = "Timestamp (time since system boot)."]
28441 pub time_boot_ms: u32,
28442 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28443 pub total_capacity: f32,
28444 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28445 pub used_capacity: f32,
28446 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28447 pub available_capacity: f32,
28448 #[doc = "Read speed."]
28449 pub read_speed: f32,
28450 #[doc = "Write speed."]
28451 pub write_speed: f32,
28452 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28453 pub storage_id: u8,
28454 #[doc = "Number of storage devices"]
28455 pub storage_count: u8,
28456 #[doc = "Status of storage"]
28457 pub status: StorageStatus,
28458 #[doc = "Type of storage"]
28459 #[cfg_attr(feature = "serde", serde(default))]
28460 pub mavtype: StorageType,
28461 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28462 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28463 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28464 pub name: [u8; 32],
28465 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28466 #[cfg_attr(feature = "serde", serde(default))]
28467 pub storage_usage: StorageUsageFlag,
28468}
28469impl STORAGE_INFORMATION_DATA {
28470 pub const ENCODED_LEN: usize = 61usize;
28471 pub const DEFAULT: Self = Self {
28472 time_boot_ms: 0_u32,
28473 total_capacity: 0.0_f32,
28474 used_capacity: 0.0_f32,
28475 available_capacity: 0.0_f32,
28476 read_speed: 0.0_f32,
28477 write_speed: 0.0_f32,
28478 storage_id: 0_u8,
28479 storage_count: 0_u8,
28480 status: StorageStatus::DEFAULT,
28481 mavtype: StorageType::DEFAULT,
28482 name: [0_u8; 32usize],
28483 storage_usage: StorageUsageFlag::DEFAULT,
28484 };
28485 #[cfg(feature = "arbitrary")]
28486 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28487 use arbitrary::{Arbitrary, Unstructured};
28488 let mut buf = [0u8; 1024];
28489 rng.fill_bytes(&mut buf);
28490 let mut unstructured = Unstructured::new(&buf);
28491 Self::arbitrary(&mut unstructured).unwrap_or_default()
28492 }
28493}
28494impl Default for STORAGE_INFORMATION_DATA {
28495 fn default() -> Self {
28496 Self::DEFAULT.clone()
28497 }
28498}
28499impl MessageData for STORAGE_INFORMATION_DATA {
28500 type Message = MavMessage;
28501 const ID: u32 = 261u32;
28502 const NAME: &'static str = "STORAGE_INFORMATION";
28503 const EXTRA_CRC: u8 = 179u8;
28504 const ENCODED_LEN: usize = 61usize;
28505 fn deser(
28506 _version: MavlinkVersion,
28507 __input: &[u8],
28508 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28509 let avail_len = __input.len();
28510 let mut payload_buf = [0; Self::ENCODED_LEN];
28511 let mut buf = if avail_len < Self::ENCODED_LEN {
28512 payload_buf[0..avail_len].copy_from_slice(__input);
28513 Bytes::new(&payload_buf)
28514 } else {
28515 Bytes::new(__input)
28516 };
28517 let mut __struct = Self::default();
28518 __struct.time_boot_ms = buf.get_u32_le();
28519 __struct.total_capacity = buf.get_f32_le();
28520 __struct.used_capacity = buf.get_f32_le();
28521 __struct.available_capacity = buf.get_f32_le();
28522 __struct.read_speed = buf.get_f32_le();
28523 __struct.write_speed = buf.get_f32_le();
28524 __struct.storage_id = buf.get_u8();
28525 __struct.storage_count = buf.get_u8();
28526 let tmp = buf.get_u8();
28527 __struct.status =
28528 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28529 enum_type: "StorageStatus",
28530 value: tmp as u32,
28531 })?;
28532 let tmp = buf.get_u8();
28533 __struct.mavtype =
28534 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28535 enum_type: "StorageType",
28536 value: tmp as u32,
28537 })?;
28538 for v in &mut __struct.name {
28539 let val = buf.get_u8();
28540 *v = val;
28541 }
28542 let tmp = buf.get_u8();
28543 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28544 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28545 flag_type: "StorageUsageFlag",
28546 value: tmp as u32,
28547 })?;
28548 Ok(__struct)
28549 }
28550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28551 let mut __tmp = BytesMut::new(bytes);
28552 #[allow(clippy::absurd_extreme_comparisons)]
28553 #[allow(unused_comparisons)]
28554 if __tmp.remaining() < Self::ENCODED_LEN {
28555 panic!(
28556 "buffer is too small (need {} bytes, but got {})",
28557 Self::ENCODED_LEN,
28558 __tmp.remaining(),
28559 )
28560 }
28561 __tmp.put_u32_le(self.time_boot_ms);
28562 __tmp.put_f32_le(self.total_capacity);
28563 __tmp.put_f32_le(self.used_capacity);
28564 __tmp.put_f32_le(self.available_capacity);
28565 __tmp.put_f32_le(self.read_speed);
28566 __tmp.put_f32_le(self.write_speed);
28567 __tmp.put_u8(self.storage_id);
28568 __tmp.put_u8(self.storage_count);
28569 __tmp.put_u8(self.status as u8);
28570 if matches!(version, MavlinkVersion::V2) {
28571 __tmp.put_u8(self.mavtype as u8);
28572 for val in &self.name {
28573 __tmp.put_u8(*val);
28574 }
28575 __tmp.put_u8(self.storage_usage.bits());
28576 let len = __tmp.len();
28577 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28578 } else {
28579 __tmp.len()
28580 }
28581 }
28582}
28583#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28584#[doc = ""]
28585#[doc = "ID: 401"]
28586#[derive(Debug, Clone, PartialEq)]
28587#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28588#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28589pub struct SUPPORTED_TUNES_DATA {
28590 #[doc = "Bitfield of supported tune formats."]
28591 pub format: TuneFormat,
28592 #[doc = "System ID"]
28593 pub target_system: u8,
28594 #[doc = "Component ID"]
28595 pub target_component: u8,
28596}
28597impl SUPPORTED_TUNES_DATA {
28598 pub const ENCODED_LEN: usize = 6usize;
28599 pub const DEFAULT: Self = Self {
28600 format: TuneFormat::DEFAULT,
28601 target_system: 0_u8,
28602 target_component: 0_u8,
28603 };
28604 #[cfg(feature = "arbitrary")]
28605 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28606 use arbitrary::{Arbitrary, Unstructured};
28607 let mut buf = [0u8; 1024];
28608 rng.fill_bytes(&mut buf);
28609 let mut unstructured = Unstructured::new(&buf);
28610 Self::arbitrary(&mut unstructured).unwrap_or_default()
28611 }
28612}
28613impl Default for SUPPORTED_TUNES_DATA {
28614 fn default() -> Self {
28615 Self::DEFAULT.clone()
28616 }
28617}
28618impl MessageData for SUPPORTED_TUNES_DATA {
28619 type Message = MavMessage;
28620 const ID: u32 = 401u32;
28621 const NAME: &'static str = "SUPPORTED_TUNES";
28622 const EXTRA_CRC: u8 = 183u8;
28623 const ENCODED_LEN: usize = 6usize;
28624 fn deser(
28625 _version: MavlinkVersion,
28626 __input: &[u8],
28627 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28628 let avail_len = __input.len();
28629 let mut payload_buf = [0; Self::ENCODED_LEN];
28630 let mut buf = if avail_len < Self::ENCODED_LEN {
28631 payload_buf[0..avail_len].copy_from_slice(__input);
28632 Bytes::new(&payload_buf)
28633 } else {
28634 Bytes::new(__input)
28635 };
28636 let mut __struct = Self::default();
28637 let tmp = buf.get_u32_le();
28638 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28639 ::mavlink_core::error::ParserError::InvalidEnum {
28640 enum_type: "TuneFormat",
28641 value: tmp as u32,
28642 },
28643 )?;
28644 __struct.target_system = buf.get_u8();
28645 __struct.target_component = buf.get_u8();
28646 Ok(__struct)
28647 }
28648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28649 let mut __tmp = BytesMut::new(bytes);
28650 #[allow(clippy::absurd_extreme_comparisons)]
28651 #[allow(unused_comparisons)]
28652 if __tmp.remaining() < Self::ENCODED_LEN {
28653 panic!(
28654 "buffer is too small (need {} bytes, but got {})",
28655 Self::ENCODED_LEN,
28656 __tmp.remaining(),
28657 )
28658 }
28659 __tmp.put_u32_le(self.format as u32);
28660 __tmp.put_u8(self.target_system);
28661 __tmp.put_u8(self.target_component);
28662 if matches!(version, MavlinkVersion::V2) {
28663 let len = __tmp.len();
28664 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28665 } else {
28666 __tmp.len()
28667 }
28668 }
28669}
28670#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
28671#[doc = ""]
28672#[doc = "ID: 2"]
28673#[derive(Debug, Clone, PartialEq)]
28674#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28675#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28676pub struct SYSTEM_TIME_DATA {
28677 #[doc = "Timestamp (UNIX epoch time)."]
28678 pub time_unix_usec: u64,
28679 #[doc = "Timestamp (time since system boot)."]
28680 pub time_boot_ms: u32,
28681}
28682impl SYSTEM_TIME_DATA {
28683 pub const ENCODED_LEN: usize = 12usize;
28684 pub const DEFAULT: Self = Self {
28685 time_unix_usec: 0_u64,
28686 time_boot_ms: 0_u32,
28687 };
28688 #[cfg(feature = "arbitrary")]
28689 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28690 use arbitrary::{Arbitrary, Unstructured};
28691 let mut buf = [0u8; 1024];
28692 rng.fill_bytes(&mut buf);
28693 let mut unstructured = Unstructured::new(&buf);
28694 Self::arbitrary(&mut unstructured).unwrap_or_default()
28695 }
28696}
28697impl Default for SYSTEM_TIME_DATA {
28698 fn default() -> Self {
28699 Self::DEFAULT.clone()
28700 }
28701}
28702impl MessageData for SYSTEM_TIME_DATA {
28703 type Message = MavMessage;
28704 const ID: u32 = 2u32;
28705 const NAME: &'static str = "SYSTEM_TIME";
28706 const EXTRA_CRC: u8 = 137u8;
28707 const ENCODED_LEN: usize = 12usize;
28708 fn deser(
28709 _version: MavlinkVersion,
28710 __input: &[u8],
28711 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28712 let avail_len = __input.len();
28713 let mut payload_buf = [0; Self::ENCODED_LEN];
28714 let mut buf = if avail_len < Self::ENCODED_LEN {
28715 payload_buf[0..avail_len].copy_from_slice(__input);
28716 Bytes::new(&payload_buf)
28717 } else {
28718 Bytes::new(__input)
28719 };
28720 let mut __struct = Self::default();
28721 __struct.time_unix_usec = buf.get_u64_le();
28722 __struct.time_boot_ms = buf.get_u32_le();
28723 Ok(__struct)
28724 }
28725 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28726 let mut __tmp = BytesMut::new(bytes);
28727 #[allow(clippy::absurd_extreme_comparisons)]
28728 #[allow(unused_comparisons)]
28729 if __tmp.remaining() < Self::ENCODED_LEN {
28730 panic!(
28731 "buffer is too small (need {} bytes, but got {})",
28732 Self::ENCODED_LEN,
28733 __tmp.remaining(),
28734 )
28735 }
28736 __tmp.put_u64_le(self.time_unix_usec);
28737 __tmp.put_u32_le(self.time_boot_ms);
28738 if matches!(version, MavlinkVersion::V2) {
28739 let len = __tmp.len();
28740 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28741 } else {
28742 __tmp.len()
28743 }
28744 }
28745}
28746#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28747#[doc = ""]
28748#[doc = "ID: 1"]
28749#[derive(Debug, Clone, PartialEq)]
28750#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28751#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28752pub struct SYS_STATUS_DATA {
28753 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28754 pub onboard_control_sensors_present: MavSysStatusSensor,
28755 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28756 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28757 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28758 pub onboard_control_sensors_health: MavSysStatusSensor,
28759 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28760 pub load: u16,
28761 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28762 pub voltage_battery: u16,
28763 #[doc = "Battery current, -1: Current not sent by autopilot"]
28764 pub current_battery: i16,
28765 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28766 pub drop_rate_comm: u16,
28767 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28768 pub errors_comm: u16,
28769 #[doc = "Autopilot-specific errors"]
28770 pub errors_count1: u16,
28771 #[doc = "Autopilot-specific errors"]
28772 pub errors_count2: u16,
28773 #[doc = "Autopilot-specific errors"]
28774 pub errors_count3: u16,
28775 #[doc = "Autopilot-specific errors"]
28776 pub errors_count4: u16,
28777 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28778 pub battery_remaining: i8,
28779 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28780 #[cfg_attr(feature = "serde", serde(default))]
28781 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28782 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28783 #[cfg_attr(feature = "serde", serde(default))]
28784 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28785 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28786 #[cfg_attr(feature = "serde", serde(default))]
28787 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28788}
28789impl SYS_STATUS_DATA {
28790 pub const ENCODED_LEN: usize = 43usize;
28791 pub const DEFAULT: Self = Self {
28792 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28793 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28794 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28795 load: 0_u16,
28796 voltage_battery: 0_u16,
28797 current_battery: 0_i16,
28798 drop_rate_comm: 0_u16,
28799 errors_comm: 0_u16,
28800 errors_count1: 0_u16,
28801 errors_count2: 0_u16,
28802 errors_count3: 0_u16,
28803 errors_count4: 0_u16,
28804 battery_remaining: 0_i8,
28805 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28806 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28807 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28808 };
28809 #[cfg(feature = "arbitrary")]
28810 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28811 use arbitrary::{Arbitrary, Unstructured};
28812 let mut buf = [0u8; 1024];
28813 rng.fill_bytes(&mut buf);
28814 let mut unstructured = Unstructured::new(&buf);
28815 Self::arbitrary(&mut unstructured).unwrap_or_default()
28816 }
28817}
28818impl Default for SYS_STATUS_DATA {
28819 fn default() -> Self {
28820 Self::DEFAULT.clone()
28821 }
28822}
28823impl MessageData for SYS_STATUS_DATA {
28824 type Message = MavMessage;
28825 const ID: u32 = 1u32;
28826 const NAME: &'static str = "SYS_STATUS";
28827 const EXTRA_CRC: u8 = 124u8;
28828 const ENCODED_LEN: usize = 43usize;
28829 fn deser(
28830 _version: MavlinkVersion,
28831 __input: &[u8],
28832 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28833 let avail_len = __input.len();
28834 let mut payload_buf = [0; Self::ENCODED_LEN];
28835 let mut buf = if avail_len < Self::ENCODED_LEN {
28836 payload_buf[0..avail_len].copy_from_slice(__input);
28837 Bytes::new(&payload_buf)
28838 } else {
28839 Bytes::new(__input)
28840 };
28841 let mut __struct = Self::default();
28842 let tmp = buf.get_u32_le();
28843 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28844 tmp & MavSysStatusSensor::all().bits(),
28845 )
28846 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28847 flag_type: "MavSysStatusSensor",
28848 value: tmp as u32,
28849 })?;
28850 let tmp = buf.get_u32_le();
28851 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28852 tmp & MavSysStatusSensor::all().bits(),
28853 )
28854 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28855 flag_type: "MavSysStatusSensor",
28856 value: tmp as u32,
28857 })?;
28858 let tmp = buf.get_u32_le();
28859 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28860 tmp & MavSysStatusSensor::all().bits(),
28861 )
28862 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28863 flag_type: "MavSysStatusSensor",
28864 value: tmp as u32,
28865 })?;
28866 __struct.load = buf.get_u16_le();
28867 __struct.voltage_battery = buf.get_u16_le();
28868 __struct.current_battery = buf.get_i16_le();
28869 __struct.drop_rate_comm = buf.get_u16_le();
28870 __struct.errors_comm = buf.get_u16_le();
28871 __struct.errors_count1 = buf.get_u16_le();
28872 __struct.errors_count2 = buf.get_u16_le();
28873 __struct.errors_count3 = buf.get_u16_le();
28874 __struct.errors_count4 = buf.get_u16_le();
28875 __struct.battery_remaining = buf.get_i8();
28876 let tmp = buf.get_u32_le();
28877 __struct.onboard_control_sensors_present_extended =
28878 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28879 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28880 flag_type: "MavSysStatusSensorExtended",
28881 value: tmp as u32,
28882 })?;
28883 let tmp = buf.get_u32_le();
28884 __struct.onboard_control_sensors_enabled_extended =
28885 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28886 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28887 flag_type: "MavSysStatusSensorExtended",
28888 value: tmp as u32,
28889 })?;
28890 let tmp = buf.get_u32_le();
28891 __struct.onboard_control_sensors_health_extended =
28892 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28893 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28894 flag_type: "MavSysStatusSensorExtended",
28895 value: tmp as u32,
28896 })?;
28897 Ok(__struct)
28898 }
28899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28900 let mut __tmp = BytesMut::new(bytes);
28901 #[allow(clippy::absurd_extreme_comparisons)]
28902 #[allow(unused_comparisons)]
28903 if __tmp.remaining() < Self::ENCODED_LEN {
28904 panic!(
28905 "buffer is too small (need {} bytes, but got {})",
28906 Self::ENCODED_LEN,
28907 __tmp.remaining(),
28908 )
28909 }
28910 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28911 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28912 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28913 __tmp.put_u16_le(self.load);
28914 __tmp.put_u16_le(self.voltage_battery);
28915 __tmp.put_i16_le(self.current_battery);
28916 __tmp.put_u16_le(self.drop_rate_comm);
28917 __tmp.put_u16_le(self.errors_comm);
28918 __tmp.put_u16_le(self.errors_count1);
28919 __tmp.put_u16_le(self.errors_count2);
28920 __tmp.put_u16_le(self.errors_count3);
28921 __tmp.put_u16_le(self.errors_count4);
28922 __tmp.put_i8(self.battery_remaining);
28923 if matches!(version, MavlinkVersion::V2) {
28924 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28925 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28926 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28927 let len = __tmp.len();
28928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28929 } else {
28930 __tmp.len()
28931 }
28932 }
28933}
28934#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
28935#[doc = ""]
28936#[doc = "ID: 135"]
28937#[derive(Debug, Clone, PartialEq)]
28938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28940pub struct TERRAIN_CHECK_DATA {
28941 #[doc = "Latitude"]
28942 pub lat: i32,
28943 #[doc = "Longitude"]
28944 pub lon: i32,
28945}
28946impl TERRAIN_CHECK_DATA {
28947 pub const ENCODED_LEN: usize = 8usize;
28948 pub const DEFAULT: Self = Self {
28949 lat: 0_i32,
28950 lon: 0_i32,
28951 };
28952 #[cfg(feature = "arbitrary")]
28953 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28954 use arbitrary::{Arbitrary, Unstructured};
28955 let mut buf = [0u8; 1024];
28956 rng.fill_bytes(&mut buf);
28957 let mut unstructured = Unstructured::new(&buf);
28958 Self::arbitrary(&mut unstructured).unwrap_or_default()
28959 }
28960}
28961impl Default for TERRAIN_CHECK_DATA {
28962 fn default() -> Self {
28963 Self::DEFAULT.clone()
28964 }
28965}
28966impl MessageData for TERRAIN_CHECK_DATA {
28967 type Message = MavMessage;
28968 const ID: u32 = 135u32;
28969 const NAME: &'static str = "TERRAIN_CHECK";
28970 const EXTRA_CRC: u8 = 203u8;
28971 const ENCODED_LEN: usize = 8usize;
28972 fn deser(
28973 _version: MavlinkVersion,
28974 __input: &[u8],
28975 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28976 let avail_len = __input.len();
28977 let mut payload_buf = [0; Self::ENCODED_LEN];
28978 let mut buf = if avail_len < Self::ENCODED_LEN {
28979 payload_buf[0..avail_len].copy_from_slice(__input);
28980 Bytes::new(&payload_buf)
28981 } else {
28982 Bytes::new(__input)
28983 };
28984 let mut __struct = Self::default();
28985 __struct.lat = buf.get_i32_le();
28986 __struct.lon = buf.get_i32_le();
28987 Ok(__struct)
28988 }
28989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28990 let mut __tmp = BytesMut::new(bytes);
28991 #[allow(clippy::absurd_extreme_comparisons)]
28992 #[allow(unused_comparisons)]
28993 if __tmp.remaining() < Self::ENCODED_LEN {
28994 panic!(
28995 "buffer is too small (need {} bytes, but got {})",
28996 Self::ENCODED_LEN,
28997 __tmp.remaining(),
28998 )
28999 }
29000 __tmp.put_i32_le(self.lat);
29001 __tmp.put_i32_le(self.lon);
29002 if matches!(version, MavlinkVersion::V2) {
29003 let len = __tmp.len();
29004 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29005 } else {
29006 __tmp.len()
29007 }
29008 }
29009}
29010#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29011#[doc = ""]
29012#[doc = "ID: 134"]
29013#[derive(Debug, Clone, PartialEq)]
29014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29015#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29016pub struct TERRAIN_DATA_DATA {
29017 #[doc = "Latitude of SW corner of first grid"]
29018 pub lat: i32,
29019 #[doc = "Longitude of SW corner of first grid"]
29020 pub lon: i32,
29021 #[doc = "Grid spacing"]
29022 pub grid_spacing: u16,
29023 #[doc = "Terrain data MSL"]
29024 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29025 pub data: [i16; 16],
29026 #[doc = "bit within the terrain request mask"]
29027 pub gridbit: u8,
29028}
29029impl TERRAIN_DATA_DATA {
29030 pub const ENCODED_LEN: usize = 43usize;
29031 pub const DEFAULT: Self = Self {
29032 lat: 0_i32,
29033 lon: 0_i32,
29034 grid_spacing: 0_u16,
29035 data: [0_i16; 16usize],
29036 gridbit: 0_u8,
29037 };
29038 #[cfg(feature = "arbitrary")]
29039 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29040 use arbitrary::{Arbitrary, Unstructured};
29041 let mut buf = [0u8; 1024];
29042 rng.fill_bytes(&mut buf);
29043 let mut unstructured = Unstructured::new(&buf);
29044 Self::arbitrary(&mut unstructured).unwrap_or_default()
29045 }
29046}
29047impl Default for TERRAIN_DATA_DATA {
29048 fn default() -> Self {
29049 Self::DEFAULT.clone()
29050 }
29051}
29052impl MessageData for TERRAIN_DATA_DATA {
29053 type Message = MavMessage;
29054 const ID: u32 = 134u32;
29055 const NAME: &'static str = "TERRAIN_DATA";
29056 const EXTRA_CRC: u8 = 229u8;
29057 const ENCODED_LEN: usize = 43usize;
29058 fn deser(
29059 _version: MavlinkVersion,
29060 __input: &[u8],
29061 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29062 let avail_len = __input.len();
29063 let mut payload_buf = [0; Self::ENCODED_LEN];
29064 let mut buf = if avail_len < Self::ENCODED_LEN {
29065 payload_buf[0..avail_len].copy_from_slice(__input);
29066 Bytes::new(&payload_buf)
29067 } else {
29068 Bytes::new(__input)
29069 };
29070 let mut __struct = Self::default();
29071 __struct.lat = buf.get_i32_le();
29072 __struct.lon = buf.get_i32_le();
29073 __struct.grid_spacing = buf.get_u16_le();
29074 for v in &mut __struct.data {
29075 let val = buf.get_i16_le();
29076 *v = val;
29077 }
29078 __struct.gridbit = buf.get_u8();
29079 Ok(__struct)
29080 }
29081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29082 let mut __tmp = BytesMut::new(bytes);
29083 #[allow(clippy::absurd_extreme_comparisons)]
29084 #[allow(unused_comparisons)]
29085 if __tmp.remaining() < Self::ENCODED_LEN {
29086 panic!(
29087 "buffer is too small (need {} bytes, but got {})",
29088 Self::ENCODED_LEN,
29089 __tmp.remaining(),
29090 )
29091 }
29092 __tmp.put_i32_le(self.lat);
29093 __tmp.put_i32_le(self.lon);
29094 __tmp.put_u16_le(self.grid_spacing);
29095 for val in &self.data {
29096 __tmp.put_i16_le(*val);
29097 }
29098 __tmp.put_u8(self.gridbit);
29099 if matches!(version, MavlinkVersion::V2) {
29100 let len = __tmp.len();
29101 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29102 } else {
29103 __tmp.len()
29104 }
29105 }
29106}
29107#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29108#[doc = ""]
29109#[doc = "ID: 136"]
29110#[derive(Debug, Clone, PartialEq)]
29111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29113pub struct TERRAIN_REPORT_DATA {
29114 #[doc = "Latitude"]
29115 pub lat: i32,
29116 #[doc = "Longitude"]
29117 pub lon: i32,
29118 #[doc = "Terrain height MSL"]
29119 pub terrain_height: f32,
29120 #[doc = "Current vehicle height above lat/lon terrain height"]
29121 pub current_height: f32,
29122 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29123 pub spacing: u16,
29124 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29125 pub pending: u16,
29126 #[doc = "Number of 4x4 terrain blocks in memory"]
29127 pub loaded: u16,
29128}
29129impl TERRAIN_REPORT_DATA {
29130 pub const ENCODED_LEN: usize = 22usize;
29131 pub const DEFAULT: Self = Self {
29132 lat: 0_i32,
29133 lon: 0_i32,
29134 terrain_height: 0.0_f32,
29135 current_height: 0.0_f32,
29136 spacing: 0_u16,
29137 pending: 0_u16,
29138 loaded: 0_u16,
29139 };
29140 #[cfg(feature = "arbitrary")]
29141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29142 use arbitrary::{Arbitrary, Unstructured};
29143 let mut buf = [0u8; 1024];
29144 rng.fill_bytes(&mut buf);
29145 let mut unstructured = Unstructured::new(&buf);
29146 Self::arbitrary(&mut unstructured).unwrap_or_default()
29147 }
29148}
29149impl Default for TERRAIN_REPORT_DATA {
29150 fn default() -> Self {
29151 Self::DEFAULT.clone()
29152 }
29153}
29154impl MessageData for TERRAIN_REPORT_DATA {
29155 type Message = MavMessage;
29156 const ID: u32 = 136u32;
29157 const NAME: &'static str = "TERRAIN_REPORT";
29158 const EXTRA_CRC: u8 = 1u8;
29159 const ENCODED_LEN: usize = 22usize;
29160 fn deser(
29161 _version: MavlinkVersion,
29162 __input: &[u8],
29163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29164 let avail_len = __input.len();
29165 let mut payload_buf = [0; Self::ENCODED_LEN];
29166 let mut buf = if avail_len < Self::ENCODED_LEN {
29167 payload_buf[0..avail_len].copy_from_slice(__input);
29168 Bytes::new(&payload_buf)
29169 } else {
29170 Bytes::new(__input)
29171 };
29172 let mut __struct = Self::default();
29173 __struct.lat = buf.get_i32_le();
29174 __struct.lon = buf.get_i32_le();
29175 __struct.terrain_height = buf.get_f32_le();
29176 __struct.current_height = buf.get_f32_le();
29177 __struct.spacing = buf.get_u16_le();
29178 __struct.pending = buf.get_u16_le();
29179 __struct.loaded = buf.get_u16_le();
29180 Ok(__struct)
29181 }
29182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29183 let mut __tmp = BytesMut::new(bytes);
29184 #[allow(clippy::absurd_extreme_comparisons)]
29185 #[allow(unused_comparisons)]
29186 if __tmp.remaining() < Self::ENCODED_LEN {
29187 panic!(
29188 "buffer is too small (need {} bytes, but got {})",
29189 Self::ENCODED_LEN,
29190 __tmp.remaining(),
29191 )
29192 }
29193 __tmp.put_i32_le(self.lat);
29194 __tmp.put_i32_le(self.lon);
29195 __tmp.put_f32_le(self.terrain_height);
29196 __tmp.put_f32_le(self.current_height);
29197 __tmp.put_u16_le(self.spacing);
29198 __tmp.put_u16_le(self.pending);
29199 __tmp.put_u16_le(self.loaded);
29200 if matches!(version, MavlinkVersion::V2) {
29201 let len = __tmp.len();
29202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29203 } else {
29204 __tmp.len()
29205 }
29206 }
29207}
29208#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29209#[doc = ""]
29210#[doc = "ID: 133"]
29211#[derive(Debug, Clone, PartialEq)]
29212#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29214pub struct TERRAIN_REQUEST_DATA {
29215 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29216 pub mask: u64,
29217 #[doc = "Latitude of SW corner of first grid"]
29218 pub lat: i32,
29219 #[doc = "Longitude of SW corner of first grid"]
29220 pub lon: i32,
29221 #[doc = "Grid spacing"]
29222 pub grid_spacing: u16,
29223}
29224impl TERRAIN_REQUEST_DATA {
29225 pub const ENCODED_LEN: usize = 18usize;
29226 pub const DEFAULT: Self = Self {
29227 mask: 0_u64,
29228 lat: 0_i32,
29229 lon: 0_i32,
29230 grid_spacing: 0_u16,
29231 };
29232 #[cfg(feature = "arbitrary")]
29233 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29234 use arbitrary::{Arbitrary, Unstructured};
29235 let mut buf = [0u8; 1024];
29236 rng.fill_bytes(&mut buf);
29237 let mut unstructured = Unstructured::new(&buf);
29238 Self::arbitrary(&mut unstructured).unwrap_or_default()
29239 }
29240}
29241impl Default for TERRAIN_REQUEST_DATA {
29242 fn default() -> Self {
29243 Self::DEFAULT.clone()
29244 }
29245}
29246impl MessageData for TERRAIN_REQUEST_DATA {
29247 type Message = MavMessage;
29248 const ID: u32 = 133u32;
29249 const NAME: &'static str = "TERRAIN_REQUEST";
29250 const EXTRA_CRC: u8 = 6u8;
29251 const ENCODED_LEN: usize = 18usize;
29252 fn deser(
29253 _version: MavlinkVersion,
29254 __input: &[u8],
29255 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29256 let avail_len = __input.len();
29257 let mut payload_buf = [0; Self::ENCODED_LEN];
29258 let mut buf = if avail_len < Self::ENCODED_LEN {
29259 payload_buf[0..avail_len].copy_from_slice(__input);
29260 Bytes::new(&payload_buf)
29261 } else {
29262 Bytes::new(__input)
29263 };
29264 let mut __struct = Self::default();
29265 __struct.mask = buf.get_u64_le();
29266 __struct.lat = buf.get_i32_le();
29267 __struct.lon = buf.get_i32_le();
29268 __struct.grid_spacing = buf.get_u16_le();
29269 Ok(__struct)
29270 }
29271 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29272 let mut __tmp = BytesMut::new(bytes);
29273 #[allow(clippy::absurd_extreme_comparisons)]
29274 #[allow(unused_comparisons)]
29275 if __tmp.remaining() < Self::ENCODED_LEN {
29276 panic!(
29277 "buffer is too small (need {} bytes, but got {})",
29278 Self::ENCODED_LEN,
29279 __tmp.remaining(),
29280 )
29281 }
29282 __tmp.put_u64_le(self.mask);
29283 __tmp.put_i32_le(self.lat);
29284 __tmp.put_i32_le(self.lon);
29285 __tmp.put_u16_le(self.grid_spacing);
29286 if matches!(version, MavlinkVersion::V2) {
29287 let len = __tmp.len();
29288 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29289 } else {
29290 __tmp.len()
29291 }
29292 }
29293}
29294#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29295#[doc = ""]
29296#[doc = "ID: 111"]
29297#[derive(Debug, Clone, PartialEq)]
29298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29299#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29300pub struct TIMESYNC_DATA {
29301 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29302 pub tc1: i64,
29303 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29304 pub ts1: i64,
29305 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29306 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29307 pub target_system: u8,
29308 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29309 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29310 pub target_component: u8,
29311}
29312impl TIMESYNC_DATA {
29313 pub const ENCODED_LEN: usize = 18usize;
29314 pub const DEFAULT: Self = Self {
29315 tc1: 0_i64,
29316 ts1: 0_i64,
29317 target_system: 0_u8,
29318 target_component: 0_u8,
29319 };
29320 #[cfg(feature = "arbitrary")]
29321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29322 use arbitrary::{Arbitrary, Unstructured};
29323 let mut buf = [0u8; 1024];
29324 rng.fill_bytes(&mut buf);
29325 let mut unstructured = Unstructured::new(&buf);
29326 Self::arbitrary(&mut unstructured).unwrap_or_default()
29327 }
29328}
29329impl Default for TIMESYNC_DATA {
29330 fn default() -> Self {
29331 Self::DEFAULT.clone()
29332 }
29333}
29334impl MessageData for TIMESYNC_DATA {
29335 type Message = MavMessage;
29336 const ID: u32 = 111u32;
29337 const NAME: &'static str = "TIMESYNC";
29338 const EXTRA_CRC: u8 = 34u8;
29339 const ENCODED_LEN: usize = 18usize;
29340 fn deser(
29341 _version: MavlinkVersion,
29342 __input: &[u8],
29343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29344 let avail_len = __input.len();
29345 let mut payload_buf = [0; Self::ENCODED_LEN];
29346 let mut buf = if avail_len < Self::ENCODED_LEN {
29347 payload_buf[0..avail_len].copy_from_slice(__input);
29348 Bytes::new(&payload_buf)
29349 } else {
29350 Bytes::new(__input)
29351 };
29352 let mut __struct = Self::default();
29353 __struct.tc1 = buf.get_i64_le();
29354 __struct.ts1 = buf.get_i64_le();
29355 __struct.target_system = buf.get_u8();
29356 __struct.target_component = buf.get_u8();
29357 Ok(__struct)
29358 }
29359 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29360 let mut __tmp = BytesMut::new(bytes);
29361 #[allow(clippy::absurd_extreme_comparisons)]
29362 #[allow(unused_comparisons)]
29363 if __tmp.remaining() < Self::ENCODED_LEN {
29364 panic!(
29365 "buffer is too small (need {} bytes, but got {})",
29366 Self::ENCODED_LEN,
29367 __tmp.remaining(),
29368 )
29369 }
29370 __tmp.put_i64_le(self.tc1);
29371 __tmp.put_i64_le(self.ts1);
29372 if matches!(version, MavlinkVersion::V2) {
29373 __tmp.put_u8(self.target_system);
29374 __tmp.put_u8(self.target_component);
29375 let len = __tmp.len();
29376 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29377 } else {
29378 __tmp.len()
29379 }
29380 }
29381}
29382#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29383#[doc = ""]
29384#[doc = "ID: 380"]
29385#[derive(Debug, Clone, PartialEq)]
29386#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29388pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29389 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29390 pub safe_return: i32,
29391 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29392 pub land: i32,
29393 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29394 pub mission_next_item: i32,
29395 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29396 pub mission_end: i32,
29397 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29398 pub commanded_action: i32,
29399}
29400impl TIME_ESTIMATE_TO_TARGET_DATA {
29401 pub const ENCODED_LEN: usize = 20usize;
29402 pub const DEFAULT: Self = Self {
29403 safe_return: 0_i32,
29404 land: 0_i32,
29405 mission_next_item: 0_i32,
29406 mission_end: 0_i32,
29407 commanded_action: 0_i32,
29408 };
29409 #[cfg(feature = "arbitrary")]
29410 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29411 use arbitrary::{Arbitrary, Unstructured};
29412 let mut buf = [0u8; 1024];
29413 rng.fill_bytes(&mut buf);
29414 let mut unstructured = Unstructured::new(&buf);
29415 Self::arbitrary(&mut unstructured).unwrap_or_default()
29416 }
29417}
29418impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
29419 fn default() -> Self {
29420 Self::DEFAULT.clone()
29421 }
29422}
29423impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
29424 type Message = MavMessage;
29425 const ID: u32 = 380u32;
29426 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
29427 const EXTRA_CRC: u8 = 232u8;
29428 const ENCODED_LEN: usize = 20usize;
29429 fn deser(
29430 _version: MavlinkVersion,
29431 __input: &[u8],
29432 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29433 let avail_len = __input.len();
29434 let mut payload_buf = [0; Self::ENCODED_LEN];
29435 let mut buf = if avail_len < Self::ENCODED_LEN {
29436 payload_buf[0..avail_len].copy_from_slice(__input);
29437 Bytes::new(&payload_buf)
29438 } else {
29439 Bytes::new(__input)
29440 };
29441 let mut __struct = Self::default();
29442 __struct.safe_return = buf.get_i32_le();
29443 __struct.land = buf.get_i32_le();
29444 __struct.mission_next_item = buf.get_i32_le();
29445 __struct.mission_end = buf.get_i32_le();
29446 __struct.commanded_action = buf.get_i32_le();
29447 Ok(__struct)
29448 }
29449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29450 let mut __tmp = BytesMut::new(bytes);
29451 #[allow(clippy::absurd_extreme_comparisons)]
29452 #[allow(unused_comparisons)]
29453 if __tmp.remaining() < Self::ENCODED_LEN {
29454 panic!(
29455 "buffer is too small (need {} bytes, but got {})",
29456 Self::ENCODED_LEN,
29457 __tmp.remaining(),
29458 )
29459 }
29460 __tmp.put_i32_le(self.safe_return);
29461 __tmp.put_i32_le(self.land);
29462 __tmp.put_i32_le(self.mission_next_item);
29463 __tmp.put_i32_le(self.mission_end);
29464 __tmp.put_i32_le(self.commanded_action);
29465 if matches!(version, MavlinkVersion::V2) {
29466 let len = __tmp.len();
29467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29468 } else {
29469 __tmp.len()
29470 }
29471 }
29472}
29473#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29474#[doc = ""]
29475#[doc = "ID: 333"]
29476#[derive(Debug, Clone, PartialEq)]
29477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29479pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29480 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29481 pub time_usec: u64,
29482 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29483 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29484 pub pos_x: [f32; 5],
29485 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29486 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29487 pub pos_y: [f32; 5],
29488 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29489 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29490 pub pos_z: [f32; 5],
29491 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29492 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29493 pub delta: [f32; 5],
29494 #[doc = "Yaw. Set to NaN for unchanged"]
29495 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29496 pub pos_yaw: [f32; 5],
29497 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29498 pub valid_points: u8,
29499}
29500impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29501 pub const ENCODED_LEN: usize = 109usize;
29502 pub const DEFAULT: Self = Self {
29503 time_usec: 0_u64,
29504 pos_x: [0.0_f32; 5usize],
29505 pos_y: [0.0_f32; 5usize],
29506 pos_z: [0.0_f32; 5usize],
29507 delta: [0.0_f32; 5usize],
29508 pos_yaw: [0.0_f32; 5usize],
29509 valid_points: 0_u8,
29510 };
29511 #[cfg(feature = "arbitrary")]
29512 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29513 use arbitrary::{Arbitrary, Unstructured};
29514 let mut buf = [0u8; 1024];
29515 rng.fill_bytes(&mut buf);
29516 let mut unstructured = Unstructured::new(&buf);
29517 Self::arbitrary(&mut unstructured).unwrap_or_default()
29518 }
29519}
29520impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29521 fn default() -> Self {
29522 Self::DEFAULT.clone()
29523 }
29524}
29525impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29526 type Message = MavMessage;
29527 const ID: u32 = 333u32;
29528 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29529 const EXTRA_CRC: u8 = 231u8;
29530 const ENCODED_LEN: usize = 109usize;
29531 fn deser(
29532 _version: MavlinkVersion,
29533 __input: &[u8],
29534 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29535 let avail_len = __input.len();
29536 let mut payload_buf = [0; Self::ENCODED_LEN];
29537 let mut buf = if avail_len < Self::ENCODED_LEN {
29538 payload_buf[0..avail_len].copy_from_slice(__input);
29539 Bytes::new(&payload_buf)
29540 } else {
29541 Bytes::new(__input)
29542 };
29543 let mut __struct = Self::default();
29544 __struct.time_usec = buf.get_u64_le();
29545 for v in &mut __struct.pos_x {
29546 let val = buf.get_f32_le();
29547 *v = val;
29548 }
29549 for v in &mut __struct.pos_y {
29550 let val = buf.get_f32_le();
29551 *v = val;
29552 }
29553 for v in &mut __struct.pos_z {
29554 let val = buf.get_f32_le();
29555 *v = val;
29556 }
29557 for v in &mut __struct.delta {
29558 let val = buf.get_f32_le();
29559 *v = val;
29560 }
29561 for v in &mut __struct.pos_yaw {
29562 let val = buf.get_f32_le();
29563 *v = val;
29564 }
29565 __struct.valid_points = buf.get_u8();
29566 Ok(__struct)
29567 }
29568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29569 let mut __tmp = BytesMut::new(bytes);
29570 #[allow(clippy::absurd_extreme_comparisons)]
29571 #[allow(unused_comparisons)]
29572 if __tmp.remaining() < Self::ENCODED_LEN {
29573 panic!(
29574 "buffer is too small (need {} bytes, but got {})",
29575 Self::ENCODED_LEN,
29576 __tmp.remaining(),
29577 )
29578 }
29579 __tmp.put_u64_le(self.time_usec);
29580 for val in &self.pos_x {
29581 __tmp.put_f32_le(*val);
29582 }
29583 for val in &self.pos_y {
29584 __tmp.put_f32_le(*val);
29585 }
29586 for val in &self.pos_z {
29587 __tmp.put_f32_le(*val);
29588 }
29589 for val in &self.delta {
29590 __tmp.put_f32_le(*val);
29591 }
29592 for val in &self.pos_yaw {
29593 __tmp.put_f32_le(*val);
29594 }
29595 __tmp.put_u8(self.valid_points);
29596 if matches!(version, MavlinkVersion::V2) {
29597 let len = __tmp.len();
29598 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29599 } else {
29600 __tmp.len()
29601 }
29602 }
29603}
29604#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29605#[doc = ""]
29606#[doc = "ID: 332"]
29607#[derive(Debug, Clone, PartialEq)]
29608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29609#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29610pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29611 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29612 pub time_usec: u64,
29613 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29614 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29615 pub pos_x: [f32; 5],
29616 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29617 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29618 pub pos_y: [f32; 5],
29619 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29620 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29621 pub pos_z: [f32; 5],
29622 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29623 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29624 pub vel_x: [f32; 5],
29625 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
29626 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29627 pub vel_y: [f32; 5],
29628 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
29629 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29630 pub vel_z: [f32; 5],
29631 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
29632 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29633 pub acc_x: [f32; 5],
29634 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
29635 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29636 pub acc_y: [f32; 5],
29637 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
29638 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29639 pub acc_z: [f32; 5],
29640 #[doc = "Yaw angle, set to NaN if not being used"]
29641 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29642 pub pos_yaw: [f32; 5],
29643 #[doc = "Yaw rate, set to NaN if not being used"]
29644 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29645 pub vel_yaw: [f32; 5],
29646 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
29647 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29648 pub command: [u16; 5],
29649 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
29650 pub valid_points: u8,
29651}
29652impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29653 pub const ENCODED_LEN: usize = 239usize;
29654 pub const DEFAULT: Self = Self {
29655 time_usec: 0_u64,
29656 pos_x: [0.0_f32; 5usize],
29657 pos_y: [0.0_f32; 5usize],
29658 pos_z: [0.0_f32; 5usize],
29659 vel_x: [0.0_f32; 5usize],
29660 vel_y: [0.0_f32; 5usize],
29661 vel_z: [0.0_f32; 5usize],
29662 acc_x: [0.0_f32; 5usize],
29663 acc_y: [0.0_f32; 5usize],
29664 acc_z: [0.0_f32; 5usize],
29665 pos_yaw: [0.0_f32; 5usize],
29666 vel_yaw: [0.0_f32; 5usize],
29667 command: [0_u16; 5usize],
29668 valid_points: 0_u8,
29669 };
29670 #[cfg(feature = "arbitrary")]
29671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29672 use arbitrary::{Arbitrary, Unstructured};
29673 let mut buf = [0u8; 1024];
29674 rng.fill_bytes(&mut buf);
29675 let mut unstructured = Unstructured::new(&buf);
29676 Self::arbitrary(&mut unstructured).unwrap_or_default()
29677 }
29678}
29679impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29680 fn default() -> Self {
29681 Self::DEFAULT.clone()
29682 }
29683}
29684impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29685 type Message = MavMessage;
29686 const ID: u32 = 332u32;
29687 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
29688 const EXTRA_CRC: u8 = 236u8;
29689 const ENCODED_LEN: usize = 239usize;
29690 fn deser(
29691 _version: MavlinkVersion,
29692 __input: &[u8],
29693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29694 let avail_len = __input.len();
29695 let mut payload_buf = [0; Self::ENCODED_LEN];
29696 let mut buf = if avail_len < Self::ENCODED_LEN {
29697 payload_buf[0..avail_len].copy_from_slice(__input);
29698 Bytes::new(&payload_buf)
29699 } else {
29700 Bytes::new(__input)
29701 };
29702 let mut __struct = Self::default();
29703 __struct.time_usec = buf.get_u64_le();
29704 for v in &mut __struct.pos_x {
29705 let val = buf.get_f32_le();
29706 *v = val;
29707 }
29708 for v in &mut __struct.pos_y {
29709 let val = buf.get_f32_le();
29710 *v = val;
29711 }
29712 for v in &mut __struct.pos_z {
29713 let val = buf.get_f32_le();
29714 *v = val;
29715 }
29716 for v in &mut __struct.vel_x {
29717 let val = buf.get_f32_le();
29718 *v = val;
29719 }
29720 for v in &mut __struct.vel_y {
29721 let val = buf.get_f32_le();
29722 *v = val;
29723 }
29724 for v in &mut __struct.vel_z {
29725 let val = buf.get_f32_le();
29726 *v = val;
29727 }
29728 for v in &mut __struct.acc_x {
29729 let val = buf.get_f32_le();
29730 *v = val;
29731 }
29732 for v in &mut __struct.acc_y {
29733 let val = buf.get_f32_le();
29734 *v = val;
29735 }
29736 for v in &mut __struct.acc_z {
29737 let val = buf.get_f32_le();
29738 *v = val;
29739 }
29740 for v in &mut __struct.pos_yaw {
29741 let val = buf.get_f32_le();
29742 *v = val;
29743 }
29744 for v in &mut __struct.vel_yaw {
29745 let val = buf.get_f32_le();
29746 *v = val;
29747 }
29748 for v in &mut __struct.command {
29749 let val = buf.get_u16_le();
29750 *v = val;
29751 }
29752 __struct.valid_points = buf.get_u8();
29753 Ok(__struct)
29754 }
29755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29756 let mut __tmp = BytesMut::new(bytes);
29757 #[allow(clippy::absurd_extreme_comparisons)]
29758 #[allow(unused_comparisons)]
29759 if __tmp.remaining() < Self::ENCODED_LEN {
29760 panic!(
29761 "buffer is too small (need {} bytes, but got {})",
29762 Self::ENCODED_LEN,
29763 __tmp.remaining(),
29764 )
29765 }
29766 __tmp.put_u64_le(self.time_usec);
29767 for val in &self.pos_x {
29768 __tmp.put_f32_le(*val);
29769 }
29770 for val in &self.pos_y {
29771 __tmp.put_f32_le(*val);
29772 }
29773 for val in &self.pos_z {
29774 __tmp.put_f32_le(*val);
29775 }
29776 for val in &self.vel_x {
29777 __tmp.put_f32_le(*val);
29778 }
29779 for val in &self.vel_y {
29780 __tmp.put_f32_le(*val);
29781 }
29782 for val in &self.vel_z {
29783 __tmp.put_f32_le(*val);
29784 }
29785 for val in &self.acc_x {
29786 __tmp.put_f32_le(*val);
29787 }
29788 for val in &self.acc_y {
29789 __tmp.put_f32_le(*val);
29790 }
29791 for val in &self.acc_z {
29792 __tmp.put_f32_le(*val);
29793 }
29794 for val in &self.pos_yaw {
29795 __tmp.put_f32_le(*val);
29796 }
29797 for val in &self.vel_yaw {
29798 __tmp.put_f32_le(*val);
29799 }
29800 for val in &self.command {
29801 __tmp.put_u16_le(*val);
29802 }
29803 __tmp.put_u8(self.valid_points);
29804 if matches!(version, MavlinkVersion::V2) {
29805 let len = __tmp.len();
29806 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29807 } else {
29808 __tmp.len()
29809 }
29810 }
29811}
29812#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
29813#[doc = ""]
29814#[doc = "ID: 385"]
29815#[derive(Debug, Clone, PartialEq)]
29816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29818pub struct TUNNEL_DATA {
29819 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29820 pub payload_type: MavTunnelPayloadType,
29821 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
29822 pub target_system: u8,
29823 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
29824 pub target_component: u8,
29825 #[doc = "Length of the data transported in payload"]
29826 pub payload_length: u8,
29827 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
29828 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29829 pub payload: [u8; 128],
29830}
29831impl TUNNEL_DATA {
29832 pub const ENCODED_LEN: usize = 133usize;
29833 pub const DEFAULT: Self = Self {
29834 payload_type: MavTunnelPayloadType::DEFAULT,
29835 target_system: 0_u8,
29836 target_component: 0_u8,
29837 payload_length: 0_u8,
29838 payload: [0_u8; 128usize],
29839 };
29840 #[cfg(feature = "arbitrary")]
29841 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29842 use arbitrary::{Arbitrary, Unstructured};
29843 let mut buf = [0u8; 1024];
29844 rng.fill_bytes(&mut buf);
29845 let mut unstructured = Unstructured::new(&buf);
29846 Self::arbitrary(&mut unstructured).unwrap_or_default()
29847 }
29848}
29849impl Default for TUNNEL_DATA {
29850 fn default() -> Self {
29851 Self::DEFAULT.clone()
29852 }
29853}
29854impl MessageData for TUNNEL_DATA {
29855 type Message = MavMessage;
29856 const ID: u32 = 385u32;
29857 const NAME: &'static str = "TUNNEL";
29858 const EXTRA_CRC: u8 = 147u8;
29859 const ENCODED_LEN: usize = 133usize;
29860 fn deser(
29861 _version: MavlinkVersion,
29862 __input: &[u8],
29863 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29864 let avail_len = __input.len();
29865 let mut payload_buf = [0; Self::ENCODED_LEN];
29866 let mut buf = if avail_len < Self::ENCODED_LEN {
29867 payload_buf[0..avail_len].copy_from_slice(__input);
29868 Bytes::new(&payload_buf)
29869 } else {
29870 Bytes::new(__input)
29871 };
29872 let mut __struct = Self::default();
29873 let tmp = buf.get_u16_le();
29874 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
29875 ::mavlink_core::error::ParserError::InvalidEnum {
29876 enum_type: "MavTunnelPayloadType",
29877 value: tmp as u32,
29878 },
29879 )?;
29880 __struct.target_system = buf.get_u8();
29881 __struct.target_component = buf.get_u8();
29882 __struct.payload_length = buf.get_u8();
29883 for v in &mut __struct.payload {
29884 let val = buf.get_u8();
29885 *v = val;
29886 }
29887 Ok(__struct)
29888 }
29889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29890 let mut __tmp = BytesMut::new(bytes);
29891 #[allow(clippy::absurd_extreme_comparisons)]
29892 #[allow(unused_comparisons)]
29893 if __tmp.remaining() < Self::ENCODED_LEN {
29894 panic!(
29895 "buffer is too small (need {} bytes, but got {})",
29896 Self::ENCODED_LEN,
29897 __tmp.remaining(),
29898 )
29899 }
29900 __tmp.put_u16_le(self.payload_type as u16);
29901 __tmp.put_u8(self.target_system);
29902 __tmp.put_u8(self.target_component);
29903 __tmp.put_u8(self.payload_length);
29904 for val in &self.payload {
29905 __tmp.put_u8(*val);
29906 }
29907 if matches!(version, MavlinkVersion::V2) {
29908 let len = __tmp.len();
29909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29910 } else {
29911 __tmp.len()
29912 }
29913 }
29914}
29915#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
29916#[doc = ""]
29917#[doc = "ID: 311"]
29918#[derive(Debug, Clone, PartialEq)]
29919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29921pub struct UAVCAN_NODE_INFO_DATA {
29922 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29923 pub time_usec: u64,
29924 #[doc = "Time since the start-up of the node."]
29925 pub uptime_sec: u32,
29926 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
29927 pub sw_vcs_commit: u32,
29928 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
29929 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29930 pub name: [u8; 80],
29931 #[doc = "Hardware major version number."]
29932 pub hw_version_major: u8,
29933 #[doc = "Hardware minor version number."]
29934 pub hw_version_minor: u8,
29935 #[doc = "Hardware unique 128-bit ID."]
29936 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29937 pub hw_unique_id: [u8; 16],
29938 #[doc = "Software major version number."]
29939 pub sw_version_major: u8,
29940 #[doc = "Software minor version number."]
29941 pub sw_version_minor: u8,
29942}
29943impl UAVCAN_NODE_INFO_DATA {
29944 pub const ENCODED_LEN: usize = 116usize;
29945 pub const DEFAULT: Self = Self {
29946 time_usec: 0_u64,
29947 uptime_sec: 0_u32,
29948 sw_vcs_commit: 0_u32,
29949 name: [0_u8; 80usize],
29950 hw_version_major: 0_u8,
29951 hw_version_minor: 0_u8,
29952 hw_unique_id: [0_u8; 16usize],
29953 sw_version_major: 0_u8,
29954 sw_version_minor: 0_u8,
29955 };
29956 #[cfg(feature = "arbitrary")]
29957 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29958 use arbitrary::{Arbitrary, Unstructured};
29959 let mut buf = [0u8; 1024];
29960 rng.fill_bytes(&mut buf);
29961 let mut unstructured = Unstructured::new(&buf);
29962 Self::arbitrary(&mut unstructured).unwrap_or_default()
29963 }
29964}
29965impl Default for UAVCAN_NODE_INFO_DATA {
29966 fn default() -> Self {
29967 Self::DEFAULT.clone()
29968 }
29969}
29970impl MessageData for UAVCAN_NODE_INFO_DATA {
29971 type Message = MavMessage;
29972 const ID: u32 = 311u32;
29973 const NAME: &'static str = "UAVCAN_NODE_INFO";
29974 const EXTRA_CRC: u8 = 95u8;
29975 const ENCODED_LEN: usize = 116usize;
29976 fn deser(
29977 _version: MavlinkVersion,
29978 __input: &[u8],
29979 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29980 let avail_len = __input.len();
29981 let mut payload_buf = [0; Self::ENCODED_LEN];
29982 let mut buf = if avail_len < Self::ENCODED_LEN {
29983 payload_buf[0..avail_len].copy_from_slice(__input);
29984 Bytes::new(&payload_buf)
29985 } else {
29986 Bytes::new(__input)
29987 };
29988 let mut __struct = Self::default();
29989 __struct.time_usec = buf.get_u64_le();
29990 __struct.uptime_sec = buf.get_u32_le();
29991 __struct.sw_vcs_commit = buf.get_u32_le();
29992 for v in &mut __struct.name {
29993 let val = buf.get_u8();
29994 *v = val;
29995 }
29996 __struct.hw_version_major = buf.get_u8();
29997 __struct.hw_version_minor = buf.get_u8();
29998 for v in &mut __struct.hw_unique_id {
29999 let val = buf.get_u8();
30000 *v = val;
30001 }
30002 __struct.sw_version_major = buf.get_u8();
30003 __struct.sw_version_minor = buf.get_u8();
30004 Ok(__struct)
30005 }
30006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30007 let mut __tmp = BytesMut::new(bytes);
30008 #[allow(clippy::absurd_extreme_comparisons)]
30009 #[allow(unused_comparisons)]
30010 if __tmp.remaining() < Self::ENCODED_LEN {
30011 panic!(
30012 "buffer is too small (need {} bytes, but got {})",
30013 Self::ENCODED_LEN,
30014 __tmp.remaining(),
30015 )
30016 }
30017 __tmp.put_u64_le(self.time_usec);
30018 __tmp.put_u32_le(self.uptime_sec);
30019 __tmp.put_u32_le(self.sw_vcs_commit);
30020 for val in &self.name {
30021 __tmp.put_u8(*val);
30022 }
30023 __tmp.put_u8(self.hw_version_major);
30024 __tmp.put_u8(self.hw_version_minor);
30025 for val in &self.hw_unique_id {
30026 __tmp.put_u8(*val);
30027 }
30028 __tmp.put_u8(self.sw_version_major);
30029 __tmp.put_u8(self.sw_version_minor);
30030 if matches!(version, MavlinkVersion::V2) {
30031 let len = __tmp.len();
30032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30033 } else {
30034 __tmp.len()
30035 }
30036 }
30037}
30038#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30039#[doc = ""]
30040#[doc = "ID: 310"]
30041#[derive(Debug, Clone, PartialEq)]
30042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30044pub struct UAVCAN_NODE_STATUS_DATA {
30045 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30046 pub time_usec: u64,
30047 #[doc = "Time since the start-up of the node."]
30048 pub uptime_sec: u32,
30049 #[doc = "Vendor-specific status information."]
30050 pub vendor_specific_status_code: u16,
30051 #[doc = "Generalized node health status."]
30052 pub health: UavcanNodeHealth,
30053 #[doc = "Generalized operating mode."]
30054 pub mode: UavcanNodeMode,
30055 #[doc = "Not used currently."]
30056 pub sub_mode: u8,
30057}
30058impl UAVCAN_NODE_STATUS_DATA {
30059 pub const ENCODED_LEN: usize = 17usize;
30060 pub const DEFAULT: Self = Self {
30061 time_usec: 0_u64,
30062 uptime_sec: 0_u32,
30063 vendor_specific_status_code: 0_u16,
30064 health: UavcanNodeHealth::DEFAULT,
30065 mode: UavcanNodeMode::DEFAULT,
30066 sub_mode: 0_u8,
30067 };
30068 #[cfg(feature = "arbitrary")]
30069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30070 use arbitrary::{Arbitrary, Unstructured};
30071 let mut buf = [0u8; 1024];
30072 rng.fill_bytes(&mut buf);
30073 let mut unstructured = Unstructured::new(&buf);
30074 Self::arbitrary(&mut unstructured).unwrap_or_default()
30075 }
30076}
30077impl Default for UAVCAN_NODE_STATUS_DATA {
30078 fn default() -> Self {
30079 Self::DEFAULT.clone()
30080 }
30081}
30082impl MessageData for UAVCAN_NODE_STATUS_DATA {
30083 type Message = MavMessage;
30084 const ID: u32 = 310u32;
30085 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30086 const EXTRA_CRC: u8 = 28u8;
30087 const ENCODED_LEN: usize = 17usize;
30088 fn deser(
30089 _version: MavlinkVersion,
30090 __input: &[u8],
30091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30092 let avail_len = __input.len();
30093 let mut payload_buf = [0; Self::ENCODED_LEN];
30094 let mut buf = if avail_len < Self::ENCODED_LEN {
30095 payload_buf[0..avail_len].copy_from_slice(__input);
30096 Bytes::new(&payload_buf)
30097 } else {
30098 Bytes::new(__input)
30099 };
30100 let mut __struct = Self::default();
30101 __struct.time_usec = buf.get_u64_le();
30102 __struct.uptime_sec = buf.get_u32_le();
30103 __struct.vendor_specific_status_code = buf.get_u16_le();
30104 let tmp = buf.get_u8();
30105 __struct.health =
30106 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30107 enum_type: "UavcanNodeHealth",
30108 value: tmp as u32,
30109 })?;
30110 let tmp = buf.get_u8();
30111 __struct.mode =
30112 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30113 enum_type: "UavcanNodeMode",
30114 value: tmp as u32,
30115 })?;
30116 __struct.sub_mode = buf.get_u8();
30117 Ok(__struct)
30118 }
30119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30120 let mut __tmp = BytesMut::new(bytes);
30121 #[allow(clippy::absurd_extreme_comparisons)]
30122 #[allow(unused_comparisons)]
30123 if __tmp.remaining() < Self::ENCODED_LEN {
30124 panic!(
30125 "buffer is too small (need {} bytes, but got {})",
30126 Self::ENCODED_LEN,
30127 __tmp.remaining(),
30128 )
30129 }
30130 __tmp.put_u64_le(self.time_usec);
30131 __tmp.put_u32_le(self.uptime_sec);
30132 __tmp.put_u16_le(self.vendor_specific_status_code);
30133 __tmp.put_u8(self.health as u8);
30134 __tmp.put_u8(self.mode as u8);
30135 __tmp.put_u8(self.sub_mode);
30136 if matches!(version, MavlinkVersion::V2) {
30137 let len = __tmp.len();
30138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30139 } else {
30140 __tmp.len()
30141 }
30142 }
30143}
30144#[doc = "The global position resulting from GPS and sensor fusion."]
30145#[doc = ""]
30146#[doc = "ID: 340"]
30147#[derive(Debug, Clone, PartialEq)]
30148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30150pub struct UTM_GLOBAL_POSITION_DATA {
30151 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
30152 pub time: u64,
30153 #[doc = "Latitude (WGS84)"]
30154 pub lat: i32,
30155 #[doc = "Longitude (WGS84)"]
30156 pub lon: i32,
30157 #[doc = "Altitude (WGS84)"]
30158 pub alt: i32,
30159 #[doc = "Altitude above ground"]
30160 pub relative_alt: i32,
30161 #[doc = "Next waypoint, latitude (WGS84)"]
30162 pub next_lat: i32,
30163 #[doc = "Next waypoint, longitude (WGS84)"]
30164 pub next_lon: i32,
30165 #[doc = "Next waypoint, altitude (WGS84)"]
30166 pub next_alt: i32,
30167 #[doc = "Ground X speed (latitude, positive north)"]
30168 pub vx: i16,
30169 #[doc = "Ground Y speed (longitude, positive east)"]
30170 pub vy: i16,
30171 #[doc = "Ground Z speed (altitude, positive down)"]
30172 pub vz: i16,
30173 #[doc = "Horizontal position uncertainty (standard deviation)"]
30174 pub h_acc: u16,
30175 #[doc = "Altitude uncertainty (standard deviation)"]
30176 pub v_acc: u16,
30177 #[doc = "Speed uncertainty (standard deviation)"]
30178 pub vel_acc: u16,
30179 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30180 pub update_rate: u16,
30181 #[doc = "Unique UAS ID."]
30182 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30183 pub uas_id: [u8; 18],
30184 #[doc = "Flight state"]
30185 pub flight_state: UtmFlightState,
30186 #[doc = "Bitwise OR combination of the data available flags."]
30187 pub flags: UtmDataAvailFlags,
30188}
30189impl UTM_GLOBAL_POSITION_DATA {
30190 pub const ENCODED_LEN: usize = 70usize;
30191 pub const DEFAULT: Self = Self {
30192 time: 0_u64,
30193 lat: 0_i32,
30194 lon: 0_i32,
30195 alt: 0_i32,
30196 relative_alt: 0_i32,
30197 next_lat: 0_i32,
30198 next_lon: 0_i32,
30199 next_alt: 0_i32,
30200 vx: 0_i16,
30201 vy: 0_i16,
30202 vz: 0_i16,
30203 h_acc: 0_u16,
30204 v_acc: 0_u16,
30205 vel_acc: 0_u16,
30206 update_rate: 0_u16,
30207 uas_id: [0_u8; 18usize],
30208 flight_state: UtmFlightState::DEFAULT,
30209 flags: UtmDataAvailFlags::DEFAULT,
30210 };
30211 #[cfg(feature = "arbitrary")]
30212 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30213 use arbitrary::{Arbitrary, Unstructured};
30214 let mut buf = [0u8; 1024];
30215 rng.fill_bytes(&mut buf);
30216 let mut unstructured = Unstructured::new(&buf);
30217 Self::arbitrary(&mut unstructured).unwrap_or_default()
30218 }
30219}
30220impl Default for UTM_GLOBAL_POSITION_DATA {
30221 fn default() -> Self {
30222 Self::DEFAULT.clone()
30223 }
30224}
30225impl MessageData for UTM_GLOBAL_POSITION_DATA {
30226 type Message = MavMessage;
30227 const ID: u32 = 340u32;
30228 const NAME: &'static str = "UTM_GLOBAL_POSITION";
30229 const EXTRA_CRC: u8 = 99u8;
30230 const ENCODED_LEN: usize = 70usize;
30231 fn deser(
30232 _version: MavlinkVersion,
30233 __input: &[u8],
30234 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30235 let avail_len = __input.len();
30236 let mut payload_buf = [0; Self::ENCODED_LEN];
30237 let mut buf = if avail_len < Self::ENCODED_LEN {
30238 payload_buf[0..avail_len].copy_from_slice(__input);
30239 Bytes::new(&payload_buf)
30240 } else {
30241 Bytes::new(__input)
30242 };
30243 let mut __struct = Self::default();
30244 __struct.time = buf.get_u64_le();
30245 __struct.lat = buf.get_i32_le();
30246 __struct.lon = buf.get_i32_le();
30247 __struct.alt = buf.get_i32_le();
30248 __struct.relative_alt = buf.get_i32_le();
30249 __struct.next_lat = buf.get_i32_le();
30250 __struct.next_lon = buf.get_i32_le();
30251 __struct.next_alt = buf.get_i32_le();
30252 __struct.vx = buf.get_i16_le();
30253 __struct.vy = buf.get_i16_le();
30254 __struct.vz = buf.get_i16_le();
30255 __struct.h_acc = buf.get_u16_le();
30256 __struct.v_acc = buf.get_u16_le();
30257 __struct.vel_acc = buf.get_u16_le();
30258 __struct.update_rate = buf.get_u16_le();
30259 for v in &mut __struct.uas_id {
30260 let val = buf.get_u8();
30261 *v = val;
30262 }
30263 let tmp = buf.get_u8();
30264 __struct.flight_state =
30265 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30266 enum_type: "UtmFlightState",
30267 value: tmp as u32,
30268 })?;
30269 let tmp = buf.get_u8();
30270 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
30271 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30272 flag_type: "UtmDataAvailFlags",
30273 value: tmp as u32,
30274 })?;
30275 Ok(__struct)
30276 }
30277 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30278 let mut __tmp = BytesMut::new(bytes);
30279 #[allow(clippy::absurd_extreme_comparisons)]
30280 #[allow(unused_comparisons)]
30281 if __tmp.remaining() < Self::ENCODED_LEN {
30282 panic!(
30283 "buffer is too small (need {} bytes, but got {})",
30284 Self::ENCODED_LEN,
30285 __tmp.remaining(),
30286 )
30287 }
30288 __tmp.put_u64_le(self.time);
30289 __tmp.put_i32_le(self.lat);
30290 __tmp.put_i32_le(self.lon);
30291 __tmp.put_i32_le(self.alt);
30292 __tmp.put_i32_le(self.relative_alt);
30293 __tmp.put_i32_le(self.next_lat);
30294 __tmp.put_i32_le(self.next_lon);
30295 __tmp.put_i32_le(self.next_alt);
30296 __tmp.put_i16_le(self.vx);
30297 __tmp.put_i16_le(self.vy);
30298 __tmp.put_i16_le(self.vz);
30299 __tmp.put_u16_le(self.h_acc);
30300 __tmp.put_u16_le(self.v_acc);
30301 __tmp.put_u16_le(self.vel_acc);
30302 __tmp.put_u16_le(self.update_rate);
30303 for val in &self.uas_id {
30304 __tmp.put_u8(*val);
30305 }
30306 __tmp.put_u8(self.flight_state as u8);
30307 __tmp.put_u8(self.flags.bits());
30308 if matches!(version, MavlinkVersion::V2) {
30309 let len = __tmp.len();
30310 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30311 } else {
30312 __tmp.len()
30313 }
30314 }
30315}
30316#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
30317#[doc = ""]
30318#[doc = "ID: 248"]
30319#[derive(Debug, Clone, PartialEq)]
30320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30322pub struct V2_EXTENSION_DATA {
30323 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30324 pub message_type: u16,
30325 #[doc = "Network ID (0 for broadcast)"]
30326 pub target_network: u8,
30327 #[doc = "System ID (0 for broadcast)"]
30328 pub target_system: u8,
30329 #[doc = "Component ID (0 for broadcast)"]
30330 pub target_component: u8,
30331 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
30332 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30333 pub payload: [u8; 249],
30334}
30335impl V2_EXTENSION_DATA {
30336 pub const ENCODED_LEN: usize = 254usize;
30337 pub const DEFAULT: Self = Self {
30338 message_type: 0_u16,
30339 target_network: 0_u8,
30340 target_system: 0_u8,
30341 target_component: 0_u8,
30342 payload: [0_u8; 249usize],
30343 };
30344 #[cfg(feature = "arbitrary")]
30345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30346 use arbitrary::{Arbitrary, Unstructured};
30347 let mut buf = [0u8; 1024];
30348 rng.fill_bytes(&mut buf);
30349 let mut unstructured = Unstructured::new(&buf);
30350 Self::arbitrary(&mut unstructured).unwrap_or_default()
30351 }
30352}
30353impl Default for V2_EXTENSION_DATA {
30354 fn default() -> Self {
30355 Self::DEFAULT.clone()
30356 }
30357}
30358impl MessageData for V2_EXTENSION_DATA {
30359 type Message = MavMessage;
30360 const ID: u32 = 248u32;
30361 const NAME: &'static str = "V2_EXTENSION";
30362 const EXTRA_CRC: u8 = 8u8;
30363 const ENCODED_LEN: usize = 254usize;
30364 fn deser(
30365 _version: MavlinkVersion,
30366 __input: &[u8],
30367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30368 let avail_len = __input.len();
30369 let mut payload_buf = [0; Self::ENCODED_LEN];
30370 let mut buf = if avail_len < Self::ENCODED_LEN {
30371 payload_buf[0..avail_len].copy_from_slice(__input);
30372 Bytes::new(&payload_buf)
30373 } else {
30374 Bytes::new(__input)
30375 };
30376 let mut __struct = Self::default();
30377 __struct.message_type = buf.get_u16_le();
30378 __struct.target_network = buf.get_u8();
30379 __struct.target_system = buf.get_u8();
30380 __struct.target_component = buf.get_u8();
30381 for v in &mut __struct.payload {
30382 let val = buf.get_u8();
30383 *v = val;
30384 }
30385 Ok(__struct)
30386 }
30387 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30388 let mut __tmp = BytesMut::new(bytes);
30389 #[allow(clippy::absurd_extreme_comparisons)]
30390 #[allow(unused_comparisons)]
30391 if __tmp.remaining() < Self::ENCODED_LEN {
30392 panic!(
30393 "buffer is too small (need {} bytes, but got {})",
30394 Self::ENCODED_LEN,
30395 __tmp.remaining(),
30396 )
30397 }
30398 __tmp.put_u16_le(self.message_type);
30399 __tmp.put_u8(self.target_network);
30400 __tmp.put_u8(self.target_system);
30401 __tmp.put_u8(self.target_component);
30402 for val in &self.payload {
30403 __tmp.put_u8(*val);
30404 }
30405 if matches!(version, MavlinkVersion::V2) {
30406 let len = __tmp.len();
30407 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30408 } else {
30409 __tmp.len()
30410 }
30411 }
30412}
30413#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30414#[doc = ""]
30415#[doc = "ID: 74"]
30416#[derive(Debug, Clone, PartialEq)]
30417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30418#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30419pub struct VFR_HUD_DATA {
30420 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30421 pub airspeed: f32,
30422 #[doc = "Current ground speed."]
30423 pub groundspeed: f32,
30424 #[doc = "Current altitude (MSL)."]
30425 pub alt: f32,
30426 #[doc = "Current climb rate."]
30427 pub climb: f32,
30428 #[doc = "Current heading in compass units (0-360, 0=north)."]
30429 pub heading: i16,
30430 #[doc = "Current throttle setting (0 to 100)."]
30431 pub throttle: u16,
30432}
30433impl VFR_HUD_DATA {
30434 pub const ENCODED_LEN: usize = 20usize;
30435 pub const DEFAULT: Self = Self {
30436 airspeed: 0.0_f32,
30437 groundspeed: 0.0_f32,
30438 alt: 0.0_f32,
30439 climb: 0.0_f32,
30440 heading: 0_i16,
30441 throttle: 0_u16,
30442 };
30443 #[cfg(feature = "arbitrary")]
30444 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30445 use arbitrary::{Arbitrary, Unstructured};
30446 let mut buf = [0u8; 1024];
30447 rng.fill_bytes(&mut buf);
30448 let mut unstructured = Unstructured::new(&buf);
30449 Self::arbitrary(&mut unstructured).unwrap_or_default()
30450 }
30451}
30452impl Default for VFR_HUD_DATA {
30453 fn default() -> Self {
30454 Self::DEFAULT.clone()
30455 }
30456}
30457impl MessageData for VFR_HUD_DATA {
30458 type Message = MavMessage;
30459 const ID: u32 = 74u32;
30460 const NAME: &'static str = "VFR_HUD";
30461 const EXTRA_CRC: u8 = 20u8;
30462 const ENCODED_LEN: usize = 20usize;
30463 fn deser(
30464 _version: MavlinkVersion,
30465 __input: &[u8],
30466 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30467 let avail_len = __input.len();
30468 let mut payload_buf = [0; Self::ENCODED_LEN];
30469 let mut buf = if avail_len < Self::ENCODED_LEN {
30470 payload_buf[0..avail_len].copy_from_slice(__input);
30471 Bytes::new(&payload_buf)
30472 } else {
30473 Bytes::new(__input)
30474 };
30475 let mut __struct = Self::default();
30476 __struct.airspeed = buf.get_f32_le();
30477 __struct.groundspeed = buf.get_f32_le();
30478 __struct.alt = buf.get_f32_le();
30479 __struct.climb = buf.get_f32_le();
30480 __struct.heading = buf.get_i16_le();
30481 __struct.throttle = buf.get_u16_le();
30482 Ok(__struct)
30483 }
30484 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30485 let mut __tmp = BytesMut::new(bytes);
30486 #[allow(clippy::absurd_extreme_comparisons)]
30487 #[allow(unused_comparisons)]
30488 if __tmp.remaining() < Self::ENCODED_LEN {
30489 panic!(
30490 "buffer is too small (need {} bytes, but got {})",
30491 Self::ENCODED_LEN,
30492 __tmp.remaining(),
30493 )
30494 }
30495 __tmp.put_f32_le(self.airspeed);
30496 __tmp.put_f32_le(self.groundspeed);
30497 __tmp.put_f32_le(self.alt);
30498 __tmp.put_f32_le(self.climb);
30499 __tmp.put_i16_le(self.heading);
30500 __tmp.put_u16_le(self.throttle);
30501 if matches!(version, MavlinkVersion::V2) {
30502 let len = __tmp.len();
30503 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30504 } else {
30505 __tmp.len()
30506 }
30507 }
30508}
30509#[doc = "Vibration levels and accelerometer clipping."]
30510#[doc = ""]
30511#[doc = "ID: 241"]
30512#[derive(Debug, Clone, PartialEq)]
30513#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30515pub struct VIBRATION_DATA {
30516 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30517 pub time_usec: u64,
30518 #[doc = "Vibration levels on X-axis"]
30519 pub vibration_x: f32,
30520 #[doc = "Vibration levels on Y-axis"]
30521 pub vibration_y: f32,
30522 #[doc = "Vibration levels on Z-axis"]
30523 pub vibration_z: f32,
30524 #[doc = "first accelerometer clipping count"]
30525 pub clipping_0: u32,
30526 #[doc = "second accelerometer clipping count"]
30527 pub clipping_1: u32,
30528 #[doc = "third accelerometer clipping count"]
30529 pub clipping_2: u32,
30530}
30531impl VIBRATION_DATA {
30532 pub const ENCODED_LEN: usize = 32usize;
30533 pub const DEFAULT: Self = Self {
30534 time_usec: 0_u64,
30535 vibration_x: 0.0_f32,
30536 vibration_y: 0.0_f32,
30537 vibration_z: 0.0_f32,
30538 clipping_0: 0_u32,
30539 clipping_1: 0_u32,
30540 clipping_2: 0_u32,
30541 };
30542 #[cfg(feature = "arbitrary")]
30543 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30544 use arbitrary::{Arbitrary, Unstructured};
30545 let mut buf = [0u8; 1024];
30546 rng.fill_bytes(&mut buf);
30547 let mut unstructured = Unstructured::new(&buf);
30548 Self::arbitrary(&mut unstructured).unwrap_or_default()
30549 }
30550}
30551impl Default for VIBRATION_DATA {
30552 fn default() -> Self {
30553 Self::DEFAULT.clone()
30554 }
30555}
30556impl MessageData for VIBRATION_DATA {
30557 type Message = MavMessage;
30558 const ID: u32 = 241u32;
30559 const NAME: &'static str = "VIBRATION";
30560 const EXTRA_CRC: u8 = 90u8;
30561 const ENCODED_LEN: usize = 32usize;
30562 fn deser(
30563 _version: MavlinkVersion,
30564 __input: &[u8],
30565 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30566 let avail_len = __input.len();
30567 let mut payload_buf = [0; Self::ENCODED_LEN];
30568 let mut buf = if avail_len < Self::ENCODED_LEN {
30569 payload_buf[0..avail_len].copy_from_slice(__input);
30570 Bytes::new(&payload_buf)
30571 } else {
30572 Bytes::new(__input)
30573 };
30574 let mut __struct = Self::default();
30575 __struct.time_usec = buf.get_u64_le();
30576 __struct.vibration_x = buf.get_f32_le();
30577 __struct.vibration_y = buf.get_f32_le();
30578 __struct.vibration_z = buf.get_f32_le();
30579 __struct.clipping_0 = buf.get_u32_le();
30580 __struct.clipping_1 = buf.get_u32_le();
30581 __struct.clipping_2 = buf.get_u32_le();
30582 Ok(__struct)
30583 }
30584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30585 let mut __tmp = BytesMut::new(bytes);
30586 #[allow(clippy::absurd_extreme_comparisons)]
30587 #[allow(unused_comparisons)]
30588 if __tmp.remaining() < Self::ENCODED_LEN {
30589 panic!(
30590 "buffer is too small (need {} bytes, but got {})",
30591 Self::ENCODED_LEN,
30592 __tmp.remaining(),
30593 )
30594 }
30595 __tmp.put_u64_le(self.time_usec);
30596 __tmp.put_f32_le(self.vibration_x);
30597 __tmp.put_f32_le(self.vibration_y);
30598 __tmp.put_f32_le(self.vibration_z);
30599 __tmp.put_u32_le(self.clipping_0);
30600 __tmp.put_u32_le(self.clipping_1);
30601 __tmp.put_u32_le(self.clipping_2);
30602 if matches!(version, MavlinkVersion::V2) {
30603 let len = __tmp.len();
30604 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30605 } else {
30606 __tmp.len()
30607 }
30608 }
30609}
30610#[doc = "Global position estimate from a Vicon motion system source."]
30611#[doc = ""]
30612#[doc = "ID: 104"]
30613#[derive(Debug, Clone, PartialEq)]
30614#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30615#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30616pub struct VICON_POSITION_ESTIMATE_DATA {
30617 #[doc = "Timestamp (UNIX time or time since system boot)"]
30618 pub usec: u64,
30619 #[doc = "Global X position"]
30620 pub x: f32,
30621 #[doc = "Global Y position"]
30622 pub y: f32,
30623 #[doc = "Global Z position"]
30624 pub z: f32,
30625 #[doc = "Roll angle"]
30626 pub roll: f32,
30627 #[doc = "Pitch angle"]
30628 pub pitch: f32,
30629 #[doc = "Yaw angle"]
30630 pub yaw: f32,
30631 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30632 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30633 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30634 pub covariance: [f32; 21],
30635}
30636impl VICON_POSITION_ESTIMATE_DATA {
30637 pub const ENCODED_LEN: usize = 116usize;
30638 pub const DEFAULT: Self = Self {
30639 usec: 0_u64,
30640 x: 0.0_f32,
30641 y: 0.0_f32,
30642 z: 0.0_f32,
30643 roll: 0.0_f32,
30644 pitch: 0.0_f32,
30645 yaw: 0.0_f32,
30646 covariance: [0.0_f32; 21usize],
30647 };
30648 #[cfg(feature = "arbitrary")]
30649 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30650 use arbitrary::{Arbitrary, Unstructured};
30651 let mut buf = [0u8; 1024];
30652 rng.fill_bytes(&mut buf);
30653 let mut unstructured = Unstructured::new(&buf);
30654 Self::arbitrary(&mut unstructured).unwrap_or_default()
30655 }
30656}
30657impl Default for VICON_POSITION_ESTIMATE_DATA {
30658 fn default() -> Self {
30659 Self::DEFAULT.clone()
30660 }
30661}
30662impl MessageData for VICON_POSITION_ESTIMATE_DATA {
30663 type Message = MavMessage;
30664 const ID: u32 = 104u32;
30665 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
30666 const EXTRA_CRC: u8 = 56u8;
30667 const ENCODED_LEN: usize = 116usize;
30668 fn deser(
30669 _version: MavlinkVersion,
30670 __input: &[u8],
30671 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30672 let avail_len = __input.len();
30673 let mut payload_buf = [0; Self::ENCODED_LEN];
30674 let mut buf = if avail_len < Self::ENCODED_LEN {
30675 payload_buf[0..avail_len].copy_from_slice(__input);
30676 Bytes::new(&payload_buf)
30677 } else {
30678 Bytes::new(__input)
30679 };
30680 let mut __struct = Self::default();
30681 __struct.usec = buf.get_u64_le();
30682 __struct.x = buf.get_f32_le();
30683 __struct.y = buf.get_f32_le();
30684 __struct.z = buf.get_f32_le();
30685 __struct.roll = buf.get_f32_le();
30686 __struct.pitch = buf.get_f32_le();
30687 __struct.yaw = buf.get_f32_le();
30688 for v in &mut __struct.covariance {
30689 let val = buf.get_f32_le();
30690 *v = val;
30691 }
30692 Ok(__struct)
30693 }
30694 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30695 let mut __tmp = BytesMut::new(bytes);
30696 #[allow(clippy::absurd_extreme_comparisons)]
30697 #[allow(unused_comparisons)]
30698 if __tmp.remaining() < Self::ENCODED_LEN {
30699 panic!(
30700 "buffer is too small (need {} bytes, but got {})",
30701 Self::ENCODED_LEN,
30702 __tmp.remaining(),
30703 )
30704 }
30705 __tmp.put_u64_le(self.usec);
30706 __tmp.put_f32_le(self.x);
30707 __tmp.put_f32_le(self.y);
30708 __tmp.put_f32_le(self.z);
30709 __tmp.put_f32_le(self.roll);
30710 __tmp.put_f32_le(self.pitch);
30711 __tmp.put_f32_le(self.yaw);
30712 if matches!(version, MavlinkVersion::V2) {
30713 for val in &self.covariance {
30714 __tmp.put_f32_le(*val);
30715 }
30716 let len = __tmp.len();
30717 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30718 } else {
30719 __tmp.len()
30720 }
30721 }
30722}
30723#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
30724#[doc = ""]
30725#[doc = "ID: 269"]
30726#[derive(Debug, Clone, PartialEq)]
30727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30729pub struct VIDEO_STREAM_INFORMATION_DATA {
30730 #[doc = "Frame rate."]
30731 pub framerate: f32,
30732 #[doc = "Bit rate."]
30733 pub bitrate: u32,
30734 #[doc = "Bitmap of stream status flags."]
30735 pub flags: VideoStreamStatusFlags,
30736 #[doc = "Horizontal resolution."]
30737 pub resolution_h: u16,
30738 #[doc = "Vertical resolution."]
30739 pub resolution_v: u16,
30740 #[doc = "Video image rotation clockwise."]
30741 pub rotation: u16,
30742 #[doc = "Horizontal Field of view."]
30743 pub hfov: u16,
30744 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30745 pub stream_id: u8,
30746 #[doc = "Number of streams available."]
30747 pub count: u8,
30748 #[doc = "Type of stream."]
30749 pub mavtype: VideoStreamType,
30750 #[doc = "Stream name."]
30751 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30752 pub name: [u8; 32],
30753 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
30754 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30755 pub uri: [u8; 160],
30756 #[doc = "Encoding of stream."]
30757 #[cfg_attr(feature = "serde", serde(default))]
30758 pub encoding: VideoStreamEncoding,
30759 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30760 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30761 pub camera_device_id: u8,
30762}
30763impl VIDEO_STREAM_INFORMATION_DATA {
30764 pub const ENCODED_LEN: usize = 215usize;
30765 pub const DEFAULT: Self = Self {
30766 framerate: 0.0_f32,
30767 bitrate: 0_u32,
30768 flags: VideoStreamStatusFlags::DEFAULT,
30769 resolution_h: 0_u16,
30770 resolution_v: 0_u16,
30771 rotation: 0_u16,
30772 hfov: 0_u16,
30773 stream_id: 0_u8,
30774 count: 0_u8,
30775 mavtype: VideoStreamType::DEFAULT,
30776 name: [0_u8; 32usize],
30777 uri: [0_u8; 160usize],
30778 encoding: VideoStreamEncoding::DEFAULT,
30779 camera_device_id: 0_u8,
30780 };
30781 #[cfg(feature = "arbitrary")]
30782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30783 use arbitrary::{Arbitrary, Unstructured};
30784 let mut buf = [0u8; 1024];
30785 rng.fill_bytes(&mut buf);
30786 let mut unstructured = Unstructured::new(&buf);
30787 Self::arbitrary(&mut unstructured).unwrap_or_default()
30788 }
30789}
30790impl Default for VIDEO_STREAM_INFORMATION_DATA {
30791 fn default() -> Self {
30792 Self::DEFAULT.clone()
30793 }
30794}
30795impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
30796 type Message = MavMessage;
30797 const ID: u32 = 269u32;
30798 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
30799 const EXTRA_CRC: u8 = 109u8;
30800 const ENCODED_LEN: usize = 215usize;
30801 fn deser(
30802 _version: MavlinkVersion,
30803 __input: &[u8],
30804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30805 let avail_len = __input.len();
30806 let mut payload_buf = [0; Self::ENCODED_LEN];
30807 let mut buf = if avail_len < Self::ENCODED_LEN {
30808 payload_buf[0..avail_len].copy_from_slice(__input);
30809 Bytes::new(&payload_buf)
30810 } else {
30811 Bytes::new(__input)
30812 };
30813 let mut __struct = Self::default();
30814 __struct.framerate = buf.get_f32_le();
30815 __struct.bitrate = buf.get_u32_le();
30816 let tmp = buf.get_u16_le();
30817 __struct.flags = VideoStreamStatusFlags::from_bits(
30818 tmp & VideoStreamStatusFlags::all().bits(),
30819 )
30820 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30821 flag_type: "VideoStreamStatusFlags",
30822 value: tmp as u32,
30823 })?;
30824 __struct.resolution_h = buf.get_u16_le();
30825 __struct.resolution_v = buf.get_u16_le();
30826 __struct.rotation = buf.get_u16_le();
30827 __struct.hfov = buf.get_u16_le();
30828 __struct.stream_id = buf.get_u8();
30829 __struct.count = buf.get_u8();
30830 let tmp = buf.get_u8();
30831 __struct.mavtype =
30832 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30833 enum_type: "VideoStreamType",
30834 value: tmp as u32,
30835 })?;
30836 for v in &mut __struct.name {
30837 let val = buf.get_u8();
30838 *v = val;
30839 }
30840 for v in &mut __struct.uri {
30841 let val = buf.get_u8();
30842 *v = val;
30843 }
30844 let tmp = buf.get_u8();
30845 __struct.encoding =
30846 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30847 enum_type: "VideoStreamEncoding",
30848 value: tmp as u32,
30849 })?;
30850 __struct.camera_device_id = buf.get_u8();
30851 Ok(__struct)
30852 }
30853 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30854 let mut __tmp = BytesMut::new(bytes);
30855 #[allow(clippy::absurd_extreme_comparisons)]
30856 #[allow(unused_comparisons)]
30857 if __tmp.remaining() < Self::ENCODED_LEN {
30858 panic!(
30859 "buffer is too small (need {} bytes, but got {})",
30860 Self::ENCODED_LEN,
30861 __tmp.remaining(),
30862 )
30863 }
30864 __tmp.put_f32_le(self.framerate);
30865 __tmp.put_u32_le(self.bitrate);
30866 __tmp.put_u16_le(self.flags.bits());
30867 __tmp.put_u16_le(self.resolution_h);
30868 __tmp.put_u16_le(self.resolution_v);
30869 __tmp.put_u16_le(self.rotation);
30870 __tmp.put_u16_le(self.hfov);
30871 __tmp.put_u8(self.stream_id);
30872 __tmp.put_u8(self.count);
30873 __tmp.put_u8(self.mavtype as u8);
30874 for val in &self.name {
30875 __tmp.put_u8(*val);
30876 }
30877 for val in &self.uri {
30878 __tmp.put_u8(*val);
30879 }
30880 if matches!(version, MavlinkVersion::V2) {
30881 __tmp.put_u8(self.encoding as u8);
30882 __tmp.put_u8(self.camera_device_id);
30883 let len = __tmp.len();
30884 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30885 } else {
30886 __tmp.len()
30887 }
30888 }
30889}
30890#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
30891#[doc = ""]
30892#[doc = "ID: 270"]
30893#[derive(Debug, Clone, PartialEq)]
30894#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30896pub struct VIDEO_STREAM_STATUS_DATA {
30897 #[doc = "Frame rate"]
30898 pub framerate: f32,
30899 #[doc = "Bit rate"]
30900 pub bitrate: u32,
30901 #[doc = "Bitmap of stream status flags"]
30902 pub flags: VideoStreamStatusFlags,
30903 #[doc = "Horizontal resolution"]
30904 pub resolution_h: u16,
30905 #[doc = "Vertical resolution"]
30906 pub resolution_v: u16,
30907 #[doc = "Video image rotation clockwise"]
30908 pub rotation: u16,
30909 #[doc = "Horizontal Field of view"]
30910 pub hfov: u16,
30911 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30912 pub stream_id: u8,
30913 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30914 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30915 pub camera_device_id: u8,
30916}
30917impl VIDEO_STREAM_STATUS_DATA {
30918 pub const ENCODED_LEN: usize = 20usize;
30919 pub const DEFAULT: Self = Self {
30920 framerate: 0.0_f32,
30921 bitrate: 0_u32,
30922 flags: VideoStreamStatusFlags::DEFAULT,
30923 resolution_h: 0_u16,
30924 resolution_v: 0_u16,
30925 rotation: 0_u16,
30926 hfov: 0_u16,
30927 stream_id: 0_u8,
30928 camera_device_id: 0_u8,
30929 };
30930 #[cfg(feature = "arbitrary")]
30931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30932 use arbitrary::{Arbitrary, Unstructured};
30933 let mut buf = [0u8; 1024];
30934 rng.fill_bytes(&mut buf);
30935 let mut unstructured = Unstructured::new(&buf);
30936 Self::arbitrary(&mut unstructured).unwrap_or_default()
30937 }
30938}
30939impl Default for VIDEO_STREAM_STATUS_DATA {
30940 fn default() -> Self {
30941 Self::DEFAULT.clone()
30942 }
30943}
30944impl MessageData for VIDEO_STREAM_STATUS_DATA {
30945 type Message = MavMessage;
30946 const ID: u32 = 270u32;
30947 const NAME: &'static str = "VIDEO_STREAM_STATUS";
30948 const EXTRA_CRC: u8 = 59u8;
30949 const ENCODED_LEN: usize = 20usize;
30950 fn deser(
30951 _version: MavlinkVersion,
30952 __input: &[u8],
30953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30954 let avail_len = __input.len();
30955 let mut payload_buf = [0; Self::ENCODED_LEN];
30956 let mut buf = if avail_len < Self::ENCODED_LEN {
30957 payload_buf[0..avail_len].copy_from_slice(__input);
30958 Bytes::new(&payload_buf)
30959 } else {
30960 Bytes::new(__input)
30961 };
30962 let mut __struct = Self::default();
30963 __struct.framerate = buf.get_f32_le();
30964 __struct.bitrate = buf.get_u32_le();
30965 let tmp = buf.get_u16_le();
30966 __struct.flags = VideoStreamStatusFlags::from_bits(
30967 tmp & VideoStreamStatusFlags::all().bits(),
30968 )
30969 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30970 flag_type: "VideoStreamStatusFlags",
30971 value: tmp as u32,
30972 })?;
30973 __struct.resolution_h = buf.get_u16_le();
30974 __struct.resolution_v = buf.get_u16_le();
30975 __struct.rotation = buf.get_u16_le();
30976 __struct.hfov = buf.get_u16_le();
30977 __struct.stream_id = buf.get_u8();
30978 __struct.camera_device_id = buf.get_u8();
30979 Ok(__struct)
30980 }
30981 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30982 let mut __tmp = BytesMut::new(bytes);
30983 #[allow(clippy::absurd_extreme_comparisons)]
30984 #[allow(unused_comparisons)]
30985 if __tmp.remaining() < Self::ENCODED_LEN {
30986 panic!(
30987 "buffer is too small (need {} bytes, but got {})",
30988 Self::ENCODED_LEN,
30989 __tmp.remaining(),
30990 )
30991 }
30992 __tmp.put_f32_le(self.framerate);
30993 __tmp.put_u32_le(self.bitrate);
30994 __tmp.put_u16_le(self.flags.bits());
30995 __tmp.put_u16_le(self.resolution_h);
30996 __tmp.put_u16_le(self.resolution_v);
30997 __tmp.put_u16_le(self.rotation);
30998 __tmp.put_u16_le(self.hfov);
30999 __tmp.put_u8(self.stream_id);
31000 if matches!(version, MavlinkVersion::V2) {
31001 __tmp.put_u8(self.camera_device_id);
31002 let len = __tmp.len();
31003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31004 } else {
31005 __tmp.len()
31006 }
31007 }
31008}
31009#[doc = "Local position/attitude estimate from a vision source."]
31010#[doc = ""]
31011#[doc = "ID: 102"]
31012#[derive(Debug, Clone, PartialEq)]
31013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31015pub struct VISION_POSITION_ESTIMATE_DATA {
31016 #[doc = "Timestamp (UNIX time or time since system boot)"]
31017 pub usec: u64,
31018 #[doc = "Local X position"]
31019 pub x: f32,
31020 #[doc = "Local Y position"]
31021 pub y: f32,
31022 #[doc = "Local Z position"]
31023 pub z: f32,
31024 #[doc = "Roll angle"]
31025 pub roll: f32,
31026 #[doc = "Pitch angle"]
31027 pub pitch: f32,
31028 #[doc = "Yaw angle"]
31029 pub yaw: f32,
31030 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31031 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31032 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31033 pub covariance: [f32; 21],
31034 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31035 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31036 pub reset_counter: u8,
31037}
31038impl VISION_POSITION_ESTIMATE_DATA {
31039 pub const ENCODED_LEN: usize = 117usize;
31040 pub const DEFAULT: Self = Self {
31041 usec: 0_u64,
31042 x: 0.0_f32,
31043 y: 0.0_f32,
31044 z: 0.0_f32,
31045 roll: 0.0_f32,
31046 pitch: 0.0_f32,
31047 yaw: 0.0_f32,
31048 covariance: [0.0_f32; 21usize],
31049 reset_counter: 0_u8,
31050 };
31051 #[cfg(feature = "arbitrary")]
31052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31053 use arbitrary::{Arbitrary, Unstructured};
31054 let mut buf = [0u8; 1024];
31055 rng.fill_bytes(&mut buf);
31056 let mut unstructured = Unstructured::new(&buf);
31057 Self::arbitrary(&mut unstructured).unwrap_or_default()
31058 }
31059}
31060impl Default for VISION_POSITION_ESTIMATE_DATA {
31061 fn default() -> Self {
31062 Self::DEFAULT.clone()
31063 }
31064}
31065impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31066 type Message = MavMessage;
31067 const ID: u32 = 102u32;
31068 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31069 const EXTRA_CRC: u8 = 158u8;
31070 const ENCODED_LEN: usize = 117usize;
31071 fn deser(
31072 _version: MavlinkVersion,
31073 __input: &[u8],
31074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31075 let avail_len = __input.len();
31076 let mut payload_buf = [0; Self::ENCODED_LEN];
31077 let mut buf = if avail_len < Self::ENCODED_LEN {
31078 payload_buf[0..avail_len].copy_from_slice(__input);
31079 Bytes::new(&payload_buf)
31080 } else {
31081 Bytes::new(__input)
31082 };
31083 let mut __struct = Self::default();
31084 __struct.usec = buf.get_u64_le();
31085 __struct.x = buf.get_f32_le();
31086 __struct.y = buf.get_f32_le();
31087 __struct.z = buf.get_f32_le();
31088 __struct.roll = buf.get_f32_le();
31089 __struct.pitch = buf.get_f32_le();
31090 __struct.yaw = buf.get_f32_le();
31091 for v in &mut __struct.covariance {
31092 let val = buf.get_f32_le();
31093 *v = val;
31094 }
31095 __struct.reset_counter = buf.get_u8();
31096 Ok(__struct)
31097 }
31098 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31099 let mut __tmp = BytesMut::new(bytes);
31100 #[allow(clippy::absurd_extreme_comparisons)]
31101 #[allow(unused_comparisons)]
31102 if __tmp.remaining() < Self::ENCODED_LEN {
31103 panic!(
31104 "buffer is too small (need {} bytes, but got {})",
31105 Self::ENCODED_LEN,
31106 __tmp.remaining(),
31107 )
31108 }
31109 __tmp.put_u64_le(self.usec);
31110 __tmp.put_f32_le(self.x);
31111 __tmp.put_f32_le(self.y);
31112 __tmp.put_f32_le(self.z);
31113 __tmp.put_f32_le(self.roll);
31114 __tmp.put_f32_le(self.pitch);
31115 __tmp.put_f32_le(self.yaw);
31116 if matches!(version, MavlinkVersion::V2) {
31117 for val in &self.covariance {
31118 __tmp.put_f32_le(*val);
31119 }
31120 __tmp.put_u8(self.reset_counter);
31121 let len = __tmp.len();
31122 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31123 } else {
31124 __tmp.len()
31125 }
31126 }
31127}
31128#[doc = "Speed estimate from a vision source."]
31129#[doc = ""]
31130#[doc = "ID: 103"]
31131#[derive(Debug, Clone, PartialEq)]
31132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31134pub struct VISION_SPEED_ESTIMATE_DATA {
31135 #[doc = "Timestamp (UNIX time or time since system boot)"]
31136 pub usec: u64,
31137 #[doc = "Global X speed"]
31138 pub x: f32,
31139 #[doc = "Global Y speed"]
31140 pub y: f32,
31141 #[doc = "Global Z speed"]
31142 pub z: f32,
31143 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
31144 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31145 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31146 pub covariance: [f32; 9],
31147 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31148 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31149 pub reset_counter: u8,
31150}
31151impl VISION_SPEED_ESTIMATE_DATA {
31152 pub const ENCODED_LEN: usize = 57usize;
31153 pub const DEFAULT: Self = Self {
31154 usec: 0_u64,
31155 x: 0.0_f32,
31156 y: 0.0_f32,
31157 z: 0.0_f32,
31158 covariance: [0.0_f32; 9usize],
31159 reset_counter: 0_u8,
31160 };
31161 #[cfg(feature = "arbitrary")]
31162 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31163 use arbitrary::{Arbitrary, Unstructured};
31164 let mut buf = [0u8; 1024];
31165 rng.fill_bytes(&mut buf);
31166 let mut unstructured = Unstructured::new(&buf);
31167 Self::arbitrary(&mut unstructured).unwrap_or_default()
31168 }
31169}
31170impl Default for VISION_SPEED_ESTIMATE_DATA {
31171 fn default() -> Self {
31172 Self::DEFAULT.clone()
31173 }
31174}
31175impl MessageData for VISION_SPEED_ESTIMATE_DATA {
31176 type Message = MavMessage;
31177 const ID: u32 = 103u32;
31178 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
31179 const EXTRA_CRC: u8 = 208u8;
31180 const ENCODED_LEN: usize = 57usize;
31181 fn deser(
31182 _version: MavlinkVersion,
31183 __input: &[u8],
31184 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31185 let avail_len = __input.len();
31186 let mut payload_buf = [0; Self::ENCODED_LEN];
31187 let mut buf = if avail_len < Self::ENCODED_LEN {
31188 payload_buf[0..avail_len].copy_from_slice(__input);
31189 Bytes::new(&payload_buf)
31190 } else {
31191 Bytes::new(__input)
31192 };
31193 let mut __struct = Self::default();
31194 __struct.usec = buf.get_u64_le();
31195 __struct.x = buf.get_f32_le();
31196 __struct.y = buf.get_f32_le();
31197 __struct.z = buf.get_f32_le();
31198 for v in &mut __struct.covariance {
31199 let val = buf.get_f32_le();
31200 *v = val;
31201 }
31202 __struct.reset_counter = buf.get_u8();
31203 Ok(__struct)
31204 }
31205 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31206 let mut __tmp = BytesMut::new(bytes);
31207 #[allow(clippy::absurd_extreme_comparisons)]
31208 #[allow(unused_comparisons)]
31209 if __tmp.remaining() < Self::ENCODED_LEN {
31210 panic!(
31211 "buffer is too small (need {} bytes, but got {})",
31212 Self::ENCODED_LEN,
31213 __tmp.remaining(),
31214 )
31215 }
31216 __tmp.put_u64_le(self.usec);
31217 __tmp.put_f32_le(self.x);
31218 __tmp.put_f32_le(self.y);
31219 __tmp.put_f32_le(self.z);
31220 if matches!(version, MavlinkVersion::V2) {
31221 for val in &self.covariance {
31222 __tmp.put_f32_le(*val);
31223 }
31224 __tmp.put_u8(self.reset_counter);
31225 let len = __tmp.len();
31226 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31227 } else {
31228 __tmp.len()
31229 }
31230 }
31231}
31232#[doc = "Cumulative distance traveled for each reported wheel."]
31233#[doc = ""]
31234#[doc = "ID: 9000"]
31235#[derive(Debug, Clone, PartialEq)]
31236#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31237#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31238pub struct WHEEL_DISTANCE_DATA {
31239 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31240 pub time_usec: u64,
31241 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
31242 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31243 pub distance: [f64; 16],
31244 #[doc = "Number of wheels reported."]
31245 pub count: u8,
31246}
31247impl WHEEL_DISTANCE_DATA {
31248 pub const ENCODED_LEN: usize = 137usize;
31249 pub const DEFAULT: Self = Self {
31250 time_usec: 0_u64,
31251 distance: [0.0_f64; 16usize],
31252 count: 0_u8,
31253 };
31254 #[cfg(feature = "arbitrary")]
31255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31256 use arbitrary::{Arbitrary, Unstructured};
31257 let mut buf = [0u8; 1024];
31258 rng.fill_bytes(&mut buf);
31259 let mut unstructured = Unstructured::new(&buf);
31260 Self::arbitrary(&mut unstructured).unwrap_or_default()
31261 }
31262}
31263impl Default for WHEEL_DISTANCE_DATA {
31264 fn default() -> Self {
31265 Self::DEFAULT.clone()
31266 }
31267}
31268impl MessageData for WHEEL_DISTANCE_DATA {
31269 type Message = MavMessage;
31270 const ID: u32 = 9000u32;
31271 const NAME: &'static str = "WHEEL_DISTANCE";
31272 const EXTRA_CRC: u8 = 113u8;
31273 const ENCODED_LEN: usize = 137usize;
31274 fn deser(
31275 _version: MavlinkVersion,
31276 __input: &[u8],
31277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31278 let avail_len = __input.len();
31279 let mut payload_buf = [0; Self::ENCODED_LEN];
31280 let mut buf = if avail_len < Self::ENCODED_LEN {
31281 payload_buf[0..avail_len].copy_from_slice(__input);
31282 Bytes::new(&payload_buf)
31283 } else {
31284 Bytes::new(__input)
31285 };
31286 let mut __struct = Self::default();
31287 __struct.time_usec = buf.get_u64_le();
31288 for v in &mut __struct.distance {
31289 let val = buf.get_f64_le();
31290 *v = val;
31291 }
31292 __struct.count = buf.get_u8();
31293 Ok(__struct)
31294 }
31295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31296 let mut __tmp = BytesMut::new(bytes);
31297 #[allow(clippy::absurd_extreme_comparisons)]
31298 #[allow(unused_comparisons)]
31299 if __tmp.remaining() < Self::ENCODED_LEN {
31300 panic!(
31301 "buffer is too small (need {} bytes, but got {})",
31302 Self::ENCODED_LEN,
31303 __tmp.remaining(),
31304 )
31305 }
31306 __tmp.put_u64_le(self.time_usec);
31307 for val in &self.distance {
31308 __tmp.put_f64_le(*val);
31309 }
31310 __tmp.put_u8(self.count);
31311 if matches!(version, MavlinkVersion::V2) {
31312 let len = __tmp.len();
31313 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31314 } else {
31315 __tmp.len()
31316 }
31317 }
31318}
31319#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31320#[doc = ""]
31321#[doc = "ID: 299"]
31322#[derive(Debug, Clone, PartialEq)]
31323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31324#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31325pub struct WIFI_CONFIG_AP_DATA {
31326 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
31327 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31328 pub ssid: [u8; 32],
31329 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
31330 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31331 pub password: [u8; 64],
31332 #[doc = "WiFi Mode."]
31333 #[cfg_attr(feature = "serde", serde(default))]
31334 pub mode: WifiConfigApMode,
31335 #[doc = "Message acceptance response (sent back to GS)."]
31336 #[cfg_attr(feature = "serde", serde(default))]
31337 pub response: WifiConfigApResponse,
31338}
31339impl WIFI_CONFIG_AP_DATA {
31340 pub const ENCODED_LEN: usize = 98usize;
31341 pub const DEFAULT: Self = Self {
31342 ssid: [0_u8; 32usize],
31343 password: [0_u8; 64usize],
31344 mode: WifiConfigApMode::DEFAULT,
31345 response: WifiConfigApResponse::DEFAULT,
31346 };
31347 #[cfg(feature = "arbitrary")]
31348 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31349 use arbitrary::{Arbitrary, Unstructured};
31350 let mut buf = [0u8; 1024];
31351 rng.fill_bytes(&mut buf);
31352 let mut unstructured = Unstructured::new(&buf);
31353 Self::arbitrary(&mut unstructured).unwrap_or_default()
31354 }
31355}
31356impl Default for WIFI_CONFIG_AP_DATA {
31357 fn default() -> Self {
31358 Self::DEFAULT.clone()
31359 }
31360}
31361impl MessageData for WIFI_CONFIG_AP_DATA {
31362 type Message = MavMessage;
31363 const ID: u32 = 299u32;
31364 const NAME: &'static str = "WIFI_CONFIG_AP";
31365 const EXTRA_CRC: u8 = 19u8;
31366 const ENCODED_LEN: usize = 98usize;
31367 fn deser(
31368 _version: MavlinkVersion,
31369 __input: &[u8],
31370 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31371 let avail_len = __input.len();
31372 let mut payload_buf = [0; Self::ENCODED_LEN];
31373 let mut buf = if avail_len < Self::ENCODED_LEN {
31374 payload_buf[0..avail_len].copy_from_slice(__input);
31375 Bytes::new(&payload_buf)
31376 } else {
31377 Bytes::new(__input)
31378 };
31379 let mut __struct = Self::default();
31380 for v in &mut __struct.ssid {
31381 let val = buf.get_u8();
31382 *v = val;
31383 }
31384 for v in &mut __struct.password {
31385 let val = buf.get_u8();
31386 *v = val;
31387 }
31388 let tmp = buf.get_i8();
31389 __struct.mode =
31390 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31391 enum_type: "WifiConfigApMode",
31392 value: tmp as u32,
31393 })?;
31394 let tmp = buf.get_i8();
31395 __struct.response =
31396 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31397 enum_type: "WifiConfigApResponse",
31398 value: tmp as u32,
31399 })?;
31400 Ok(__struct)
31401 }
31402 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31403 let mut __tmp = BytesMut::new(bytes);
31404 #[allow(clippy::absurd_extreme_comparisons)]
31405 #[allow(unused_comparisons)]
31406 if __tmp.remaining() < Self::ENCODED_LEN {
31407 panic!(
31408 "buffer is too small (need {} bytes, but got {})",
31409 Self::ENCODED_LEN,
31410 __tmp.remaining(),
31411 )
31412 }
31413 for val in &self.ssid {
31414 __tmp.put_u8(*val);
31415 }
31416 for val in &self.password {
31417 __tmp.put_u8(*val);
31418 }
31419 if matches!(version, MavlinkVersion::V2) {
31420 __tmp.put_i8(self.mode as i8);
31421 __tmp.put_i8(self.response as i8);
31422 let len = __tmp.len();
31423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31424 } else {
31425 __tmp.len()
31426 }
31427 }
31428}
31429#[doc = "Winch status."]
31430#[doc = ""]
31431#[doc = "ID: 9005"]
31432#[derive(Debug, Clone, PartialEq)]
31433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31435pub struct WINCH_STATUS_DATA {
31436 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31437 pub time_usec: u64,
31438 #[doc = "Length of line released. NaN if unknown"]
31439 pub line_length: f32,
31440 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31441 pub speed: f32,
31442 #[doc = "Tension on the line. NaN if unknown"]
31443 pub tension: f32,
31444 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31445 pub voltage: f32,
31446 #[doc = "Current draw from the winch. NaN if unknown"]
31447 pub current: f32,
31448 #[doc = "Status flags"]
31449 pub status: MavWinchStatusFlag,
31450 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31451 pub temperature: i16,
31452}
31453impl WINCH_STATUS_DATA {
31454 pub const ENCODED_LEN: usize = 34usize;
31455 pub const DEFAULT: Self = Self {
31456 time_usec: 0_u64,
31457 line_length: 0.0_f32,
31458 speed: 0.0_f32,
31459 tension: 0.0_f32,
31460 voltage: 0.0_f32,
31461 current: 0.0_f32,
31462 status: MavWinchStatusFlag::DEFAULT,
31463 temperature: 0_i16,
31464 };
31465 #[cfg(feature = "arbitrary")]
31466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31467 use arbitrary::{Arbitrary, Unstructured};
31468 let mut buf = [0u8; 1024];
31469 rng.fill_bytes(&mut buf);
31470 let mut unstructured = Unstructured::new(&buf);
31471 Self::arbitrary(&mut unstructured).unwrap_or_default()
31472 }
31473}
31474impl Default for WINCH_STATUS_DATA {
31475 fn default() -> Self {
31476 Self::DEFAULT.clone()
31477 }
31478}
31479impl MessageData for WINCH_STATUS_DATA {
31480 type Message = MavMessage;
31481 const ID: u32 = 9005u32;
31482 const NAME: &'static str = "WINCH_STATUS";
31483 const EXTRA_CRC: u8 = 117u8;
31484 const ENCODED_LEN: usize = 34usize;
31485 fn deser(
31486 _version: MavlinkVersion,
31487 __input: &[u8],
31488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31489 let avail_len = __input.len();
31490 let mut payload_buf = [0; Self::ENCODED_LEN];
31491 let mut buf = if avail_len < Self::ENCODED_LEN {
31492 payload_buf[0..avail_len].copy_from_slice(__input);
31493 Bytes::new(&payload_buf)
31494 } else {
31495 Bytes::new(__input)
31496 };
31497 let mut __struct = Self::default();
31498 __struct.time_usec = buf.get_u64_le();
31499 __struct.line_length = buf.get_f32_le();
31500 __struct.speed = buf.get_f32_le();
31501 __struct.tension = buf.get_f32_le();
31502 __struct.voltage = buf.get_f32_le();
31503 __struct.current = buf.get_f32_le();
31504 let tmp = buf.get_u32_le();
31505 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31506 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31507 flag_type: "MavWinchStatusFlag",
31508 value: tmp as u32,
31509 })?;
31510 __struct.temperature = buf.get_i16_le();
31511 Ok(__struct)
31512 }
31513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31514 let mut __tmp = BytesMut::new(bytes);
31515 #[allow(clippy::absurd_extreme_comparisons)]
31516 #[allow(unused_comparisons)]
31517 if __tmp.remaining() < Self::ENCODED_LEN {
31518 panic!(
31519 "buffer is too small (need {} bytes, but got {})",
31520 Self::ENCODED_LEN,
31521 __tmp.remaining(),
31522 )
31523 }
31524 __tmp.put_u64_le(self.time_usec);
31525 __tmp.put_f32_le(self.line_length);
31526 __tmp.put_f32_le(self.speed);
31527 __tmp.put_f32_le(self.tension);
31528 __tmp.put_f32_le(self.voltage);
31529 __tmp.put_f32_le(self.current);
31530 __tmp.put_u32_le(self.status.bits());
31531 __tmp.put_i16_le(self.temperature);
31532 if matches!(version, MavlinkVersion::V2) {
31533 let len = __tmp.len();
31534 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31535 } else {
31536 __tmp.len()
31537 }
31538 }
31539}
31540#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31541#[doc = ""]
31542#[doc = "ID: 231"]
31543#[derive(Debug, Clone, PartialEq)]
31544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31546pub struct WIND_COV_DATA {
31547 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31548 pub time_usec: u64,
31549 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31550 pub wind_x: f32,
31551 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31552 pub wind_y: f32,
31553 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31554 pub wind_z: f32,
31555 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31556 pub var_horiz: f32,
31557 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31558 pub var_vert: f32,
31559 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31560 pub wind_alt: f32,
31561 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31562 pub horiz_accuracy: f32,
31563 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31564 pub vert_accuracy: f32,
31565}
31566impl WIND_COV_DATA {
31567 pub const ENCODED_LEN: usize = 40usize;
31568 pub const DEFAULT: Self = Self {
31569 time_usec: 0_u64,
31570 wind_x: 0.0_f32,
31571 wind_y: 0.0_f32,
31572 wind_z: 0.0_f32,
31573 var_horiz: 0.0_f32,
31574 var_vert: 0.0_f32,
31575 wind_alt: 0.0_f32,
31576 horiz_accuracy: 0.0_f32,
31577 vert_accuracy: 0.0_f32,
31578 };
31579 #[cfg(feature = "arbitrary")]
31580 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31581 use arbitrary::{Arbitrary, Unstructured};
31582 let mut buf = [0u8; 1024];
31583 rng.fill_bytes(&mut buf);
31584 let mut unstructured = Unstructured::new(&buf);
31585 Self::arbitrary(&mut unstructured).unwrap_or_default()
31586 }
31587}
31588impl Default for WIND_COV_DATA {
31589 fn default() -> Self {
31590 Self::DEFAULT.clone()
31591 }
31592}
31593impl MessageData for WIND_COV_DATA {
31594 type Message = MavMessage;
31595 const ID: u32 = 231u32;
31596 const NAME: &'static str = "WIND_COV";
31597 const EXTRA_CRC: u8 = 105u8;
31598 const ENCODED_LEN: usize = 40usize;
31599 fn deser(
31600 _version: MavlinkVersion,
31601 __input: &[u8],
31602 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31603 let avail_len = __input.len();
31604 let mut payload_buf = [0; Self::ENCODED_LEN];
31605 let mut buf = if avail_len < Self::ENCODED_LEN {
31606 payload_buf[0..avail_len].copy_from_slice(__input);
31607 Bytes::new(&payload_buf)
31608 } else {
31609 Bytes::new(__input)
31610 };
31611 let mut __struct = Self::default();
31612 __struct.time_usec = buf.get_u64_le();
31613 __struct.wind_x = buf.get_f32_le();
31614 __struct.wind_y = buf.get_f32_le();
31615 __struct.wind_z = buf.get_f32_le();
31616 __struct.var_horiz = buf.get_f32_le();
31617 __struct.var_vert = buf.get_f32_le();
31618 __struct.wind_alt = buf.get_f32_le();
31619 __struct.horiz_accuracy = buf.get_f32_le();
31620 __struct.vert_accuracy = buf.get_f32_le();
31621 Ok(__struct)
31622 }
31623 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31624 let mut __tmp = BytesMut::new(bytes);
31625 #[allow(clippy::absurd_extreme_comparisons)]
31626 #[allow(unused_comparisons)]
31627 if __tmp.remaining() < Self::ENCODED_LEN {
31628 panic!(
31629 "buffer is too small (need {} bytes, but got {})",
31630 Self::ENCODED_LEN,
31631 __tmp.remaining(),
31632 )
31633 }
31634 __tmp.put_u64_le(self.time_usec);
31635 __tmp.put_f32_le(self.wind_x);
31636 __tmp.put_f32_le(self.wind_y);
31637 __tmp.put_f32_le(self.wind_z);
31638 __tmp.put_f32_le(self.var_horiz);
31639 __tmp.put_f32_le(self.var_vert);
31640 __tmp.put_f32_le(self.wind_alt);
31641 __tmp.put_f32_le(self.horiz_accuracy);
31642 __tmp.put_f32_le(self.vert_accuracy);
31643 if matches!(version, MavlinkVersion::V2) {
31644 let len = __tmp.len();
31645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31646 } else {
31647 __tmp.len()
31648 }
31649 }
31650}
31651#[derive(Clone, PartialEq, Debug)]
31652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31653#[cfg_attr(feature = "serde", serde(tag = "type"))]
31654#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31655#[repr(u32)]
31656pub enum MavMessage {
31657 #[doc = "Set the vehicle attitude and body angular rates."]
31658 #[doc = ""]
31659 #[doc = "ID: 140"]
31660 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
31661 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
31662 #[doc = ""]
31663 #[doc = "ID: 375"]
31664 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
31665 #[doc = "The location and information of an ADSB vehicle."]
31666 #[doc = ""]
31667 #[doc = "ID: 246"]
31668 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
31669 #[doc = "The location and information of an AIS vessel."]
31670 #[doc = ""]
31671 #[doc = "ID: 301"]
31672 AIS_VESSEL(AIS_VESSEL_DATA),
31673 #[doc = "The current system altitude."]
31674 #[doc = ""]
31675 #[doc = "ID: 141"]
31676 ALTITUDE(ALTITUDE_DATA),
31677 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
31678 #[doc = ""]
31679 #[doc = "ID: 30"]
31680 ATTITUDE(ATTITUDE_DATA),
31681 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
31682 #[doc = ""]
31683 #[doc = "ID: 31"]
31684 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
31685 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
31686 #[doc = ""]
31687 #[doc = "ID: 61"]
31688 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
31689 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
31690 #[doc = ""]
31691 #[doc = "ID: 83"]
31692 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
31693 #[doc = "Motion capture attitude and position."]
31694 #[doc = ""]
31695 #[doc = "ID: 138"]
31696 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
31697 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
31698 #[doc = ""]
31699 #[doc = "ID: 7"]
31700 AUTH_KEY(AUTH_KEY_DATA),
31701 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
31702 #[doc = ""]
31703 #[doc = "ID: 286"]
31704 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
31705 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
31706 #[doc = ""]
31707 #[doc = "ID: 148"]
31708 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
31709 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
31710 #[doc = ""]
31711 #[doc = "ID: 435"]
31712 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
31713 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
31714 #[doc = ""]
31715 #[doc = "ID: 437"]
31716 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
31717 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
31718 #[doc = ""]
31719 #[doc = "ID: 372"]
31720 BATTERY_INFO(BATTERY_INFO_DATA),
31721 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
31722 #[doc = ""]
31723 #[doc = "ID: 147"]
31724 BATTERY_STATUS(BATTERY_STATUS_DATA),
31725 #[doc = "Report button state change."]
31726 #[doc = ""]
31727 #[doc = "ID: 257"]
31728 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
31729 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31730 #[doc = ""]
31731 #[doc = "ID: 262"]
31732 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
31733 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31734 #[doc = ""]
31735 #[doc = "ID: 271"]
31736 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
31737 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
31738 #[doc = ""]
31739 #[doc = "ID: 263"]
31740 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
31741 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31742 #[doc = ""]
31743 #[doc = "ID: 259"]
31744 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
31745 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31746 #[doc = ""]
31747 #[doc = "ID: 260"]
31748 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
31749 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
31750 #[doc = ""]
31751 #[doc = "ID: 277"]
31752 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
31753 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
31754 #[doc = ""]
31755 #[doc = "ID: 276"]
31756 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
31757 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
31758 #[doc = ""]
31759 #[doc = "ID: 275"]
31760 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
31761 #[doc = "Camera-IMU triggering and synchronisation message."]
31762 #[doc = ""]
31763 #[doc = "ID: 112"]
31764 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
31765 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
31766 #[doc = ""]
31767 #[doc = "ID: 387"]
31768 CANFD_FRAME(CANFD_FRAME_DATA),
31769 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
31770 #[doc = ""]
31771 #[doc = "ID: 388"]
31772 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
31773 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
31774 #[doc = ""]
31775 #[doc = "ID: 386"]
31776 CAN_FRAME(CAN_FRAME_DATA),
31777 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31778 #[doc = ""]
31779 #[doc = "ID: 336"]
31780 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
31781 #[doc = "Report current used cellular network status."]
31782 #[doc = ""]
31783 #[doc = "ID: 334"]
31784 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
31785 #[doc = "Request to control this MAV."]
31786 #[doc = ""]
31787 #[doc = "ID: 5"]
31788 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
31789 #[doc = "Accept / deny control of this MAV."]
31790 #[doc = ""]
31791 #[doc = "ID: 6"]
31792 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
31793 #[doc = "Information about a potential collision."]
31794 #[doc = ""]
31795 #[doc = "ID: 247"]
31796 COLLISION(COLLISION_DATA),
31797 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31798 #[doc = ""]
31799 #[doc = "ID: 77"]
31800 COMMAND_ACK(COMMAND_ACK_DATA),
31801 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31802 #[doc = ""]
31803 #[doc = "ID: 80"]
31804 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
31805 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31806 #[doc = ""]
31807 #[doc = "ID: 75"]
31808 COMMAND_INT(COMMAND_INT_DATA),
31809 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31810 #[doc = ""]
31811 #[doc = "ID: 76"]
31812 COMMAND_LONG(COMMAND_LONG_DATA),
31813 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
31814 #[doc = ""]
31815 #[doc = "ID: 395"]
31816 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
31817 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
31818 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
31819 #[doc = ""]
31820 #[doc = "ID: 396"]
31821 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
31822 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
31823 #[doc = ""]
31824 #[doc = "ID: 397"]
31825 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
31826 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
31827 #[doc = ""]
31828 #[doc = "ID: 146"]
31829 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
31830 #[doc = "offset response to encapsulated data."]
31831 #[doc = ""]
31832 #[doc = "ID: 50005"]
31833 CUBEPILOT_FIRMWARE_UPDATE_RESP(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA),
31834 #[doc = "Start firmware update with encapsulated data."]
31835 #[doc = ""]
31836 #[doc = "ID: 50004"]
31837 CUBEPILOT_FIRMWARE_UPDATE_START(CUBEPILOT_FIRMWARE_UPDATE_START_DATA),
31838 #[doc = "Raw RC Data."]
31839 #[doc = ""]
31840 #[doc = "ID: 50001"]
31841 CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA),
31842 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
31843 #[doc = ""]
31844 #[doc = "ID: 411"]
31845 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
31846 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
31847 #[doc = ""]
31848 #[doc = "ID: 436"]
31849 CURRENT_MODE(CURRENT_MODE_DATA),
31850 #[doc = "Data stream status information."]
31851 #[doc = ""]
31852 #[doc = "ID: 67"]
31853 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
31854 DATA_STREAM(DATA_STREAM_DATA),
31855 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
31856 #[doc = ""]
31857 #[doc = "ID: 130"]
31858 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
31859 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
31860 #[doc = ""]
31861 #[doc = "ID: 254"]
31862 DEBUG(DEBUG_DATA),
31863 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
31864 #[doc = ""]
31865 #[doc = "ID: 350"]
31866 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
31867 #[doc = "To debug something using a named 3D vector."]
31868 #[doc = ""]
31869 #[doc = "ID: 250"]
31870 DEBUG_VECT(DEBUG_VECT_DATA),
31871 #[doc = "Distance sensor information for an onboard rangefinder."]
31872 #[doc = ""]
31873 #[doc = "ID: 132"]
31874 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
31875 #[doc = "EFI status output."]
31876 #[doc = ""]
31877 #[doc = "ID: 225"]
31878 EFI_STATUS(EFI_STATUS_DATA),
31879 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
31880 #[doc = ""]
31881 #[doc = "ID: 131"]
31882 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
31883 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
31884 #[doc = ""]
31885 #[doc = "ID: 290"]
31886 ESC_INFO(ESC_INFO_DATA),
31887 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
31888 #[doc = ""]
31889 #[doc = "ID: 291"]
31890 ESC_STATUS(ESC_STATUS_DATA),
31891 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
31892 #[doc = ""]
31893 #[doc = "ID: 230"]
31894 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
31895 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
31896 #[doc = ""]
31897 #[doc = "ID: 410"]
31898 EVENT(EVENT_DATA),
31899 #[doc = "Provides state for additional features."]
31900 #[doc = ""]
31901 #[doc = "ID: 245"]
31902 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
31903 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
31904 #[doc = ""]
31905 #[doc = "ID: 162"]
31906 FENCE_STATUS(FENCE_STATUS_DATA),
31907 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
31908 #[doc = ""]
31909 #[doc = "ID: 110"]
31910 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
31911 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
31912 #[doc = ""]
31913 #[doc = "ID: 264"]
31914 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
31915 #[doc = "Current motion information from a designated system."]
31916 #[doc = ""]
31917 #[doc = "ID: 144"]
31918 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
31919 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
31920 #[doc = ""]
31921 #[doc = "ID: 371"]
31922 FUEL_STATUS(FUEL_STATUS_DATA),
31923 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
31924 #[doc = ""]
31925 #[doc = "ID: 373"]
31926 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
31927 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
31928 #[doc = ""]
31929 #[doc = "ID: 285"]
31930 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
31931 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
31932 #[doc = ""]
31933 #[doc = "ID: 283"]
31934 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
31935 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
31936 #[doc = ""]
31937 #[doc = "ID: 284"]
31938 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
31939 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
31940 #[doc = ""]
31941 #[doc = "ID: 280"]
31942 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
31943 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
31944 #[doc = ""]
31945 #[doc = "ID: 282"]
31946 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
31947 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
31948 #[doc = ""]
31949 #[doc = "ID: 288"]
31950 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
31951 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
31952 #[doc = ""]
31953 #[doc = "ID: 287"]
31954 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
31955 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
31956 #[doc = ""]
31957 #[doc = "ID: 281"]
31958 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
31959 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
31960 #[doc = ""]
31961 #[doc = "ID: 33"]
31962 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
31963 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
31964 #[doc = ""]
31965 #[doc = "ID: 63"]
31966 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
31967 #[doc = "Global position/attitude estimate from a vision source."]
31968 #[doc = ""]
31969 #[doc = "ID: 101"]
31970 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
31971 #[doc = "Second GPS data."]
31972 #[doc = ""]
31973 #[doc = "ID: 124"]
31974 GPS2_RAW(GPS2_RAW_DATA),
31975 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
31976 #[doc = ""]
31977 #[doc = "ID: 128"]
31978 GPS2_RTK(GPS2_RTK_DATA),
31979 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
31980 #[doc = ""]
31981 #[doc = "ID: 49"]
31982 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
31983 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
31984 #[doc = ""]
31985 #[doc = "ID: 123"]
31986 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
31987 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
31988 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
31989 #[doc = ""]
31990 #[doc = "ID: 232"]
31991 GPS_INPUT(GPS_INPUT_DATA),
31992 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
31993 #[doc = ""]
31994 #[doc = "ID: 24"]
31995 GPS_RAW_INT(GPS_RAW_INT_DATA),
31996 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
31997 #[doc = ""]
31998 #[doc = "ID: 233"]
31999 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32000 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32001 #[doc = ""]
32002 #[doc = "ID: 127"]
32003 GPS_RTK(GPS_RTK_DATA),
32004 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
32005 #[doc = ""]
32006 #[doc = "ID: 25"]
32007 GPS_STATUS(GPS_STATUS_DATA),
32008 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
32009 #[doc = ""]
32010 #[doc = "ID: 0"]
32011 HEARTBEAT(HEARTBEAT_DATA),
32012 #[doc = "Herelink Telemetry."]
32013 #[doc = ""]
32014 #[doc = "ID: 50003"]
32015 HERELINK_TELEM(HERELINK_TELEM_DATA),
32016 #[doc = "Information about video stream."]
32017 #[doc = ""]
32018 #[doc = "ID: 50002"]
32019 HERELINK_VIDEO_STREAM_INFORMATION(HERELINK_VIDEO_STREAM_INFORMATION_DATA),
32020 #[doc = "The IMU readings in SI units in NED body frame."]
32021 #[doc = ""]
32022 #[doc = "ID: 105"]
32023 HIGHRES_IMU(HIGHRES_IMU_DATA),
32024 #[doc = "Message appropriate for high latency connections like Iridium."]
32025 #[doc = ""]
32026 #[doc = "ID: 234"]
32027 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32028 HIGH_LATENCY(HIGH_LATENCY_DATA),
32029 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
32030 #[doc = ""]
32031 #[doc = "ID: 235"]
32032 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32033 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
32034 #[doc = ""]
32035 #[doc = "ID: 93"]
32036 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32037 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
32038 #[doc = ""]
32039 #[doc = "ID: 91"]
32040 HIL_CONTROLS(HIL_CONTROLS_DATA),
32041 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32042 #[doc = ""]
32043 #[doc = "ID: 113"]
32044 HIL_GPS(HIL_GPS_DATA),
32045 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
32046 #[doc = ""]
32047 #[doc = "ID: 114"]
32048 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32049 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
32050 #[doc = ""]
32051 #[doc = "ID: 92"]
32052 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32053 #[doc = "The IMU readings in SI units in NED body frame."]
32054 #[doc = ""]
32055 #[doc = "ID: 107"]
32056 HIL_SENSOR(HIL_SENSOR_DATA),
32057 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32058 #[doc = ""]
32059 #[doc = "ID: 90"]
32060 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32061 HIL_STATE(HIL_STATE_DATA),
32062 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32063 #[doc = ""]
32064 #[doc = "ID: 115"]
32065 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32066 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
32067 #[doc = ""]
32068 #[doc = "ID: 242"]
32069 HOME_POSITION(HOME_POSITION_DATA),
32070 #[doc = "Temperature and humidity from hygrometer."]
32071 #[doc = ""]
32072 #[doc = "ID: 12920"]
32073 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32074 #[doc = "Illuminator status."]
32075 #[doc = ""]
32076 #[doc = "ID: 440"]
32077 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32078 #[doc = "Status of the Iridium SBD link."]
32079 #[doc = ""]
32080 #[doc = "ID: 335"]
32081 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32082 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32083 #[doc = ""]
32084 #[doc = "ID: 149"]
32085 LANDING_TARGET(LANDING_TARGET_DATA),
32086 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32087 #[doc = ""]
32088 #[doc = "ID: 8"]
32089 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32090 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32091 #[doc = ""]
32092 #[doc = "ID: 32"]
32093 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32094 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32095 #[doc = ""]
32096 #[doc = "ID: 64"]
32097 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32098 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32099 #[doc = ""]
32100 #[doc = "ID: 89"]
32101 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32102 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32103 #[doc = ""]
32104 #[doc = "ID: 268"]
32105 LOGGING_ACK(LOGGING_ACK_DATA),
32106 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32107 #[doc = ""]
32108 #[doc = "ID: 266"]
32109 LOGGING_DATA(LOGGING_DATA_DATA),
32110 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
32111 #[doc = ""]
32112 #[doc = "ID: 267"]
32113 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
32114 #[doc = "Reply to LOG_REQUEST_DATA."]
32115 #[doc = ""]
32116 #[doc = "ID: 120"]
32117 LOG_DATA(LOG_DATA_DATA),
32118 #[doc = "Reply to LOG_REQUEST_LIST."]
32119 #[doc = ""]
32120 #[doc = "ID: 118"]
32121 LOG_ENTRY(LOG_ENTRY_DATA),
32122 #[doc = "Erase all logs."]
32123 #[doc = ""]
32124 #[doc = "ID: 121"]
32125 LOG_ERASE(LOG_ERASE_DATA),
32126 #[doc = "Request a chunk of a log."]
32127 #[doc = ""]
32128 #[doc = "ID: 119"]
32129 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
32130 #[doc = "Stop log transfer and resume normal logging."]
32131 #[doc = ""]
32132 #[doc = "ID: 122"]
32133 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
32134 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
32135 #[doc = ""]
32136 #[doc = "ID: 117"]
32137 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
32138 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
32139 #[doc = ""]
32140 #[doc = "ID: 192"]
32141 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
32142 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
32143 #[doc = ""]
32144 #[doc = "ID: 69"]
32145 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
32146 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
32147 #[doc = ""]
32148 #[doc = "ID: 81"]
32149 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
32150 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32151 #[doc = ""]
32152 #[doc = "ID: 249"]
32153 MEMORY_VECT(MEMORY_VECT_DATA),
32154 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
32155 #[doc = ""]
32156 #[doc = "ID: 244"]
32157 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
32158 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
32159 #[doc = ""]
32160 #[doc = "ID: 47"]
32161 MISSION_ACK(MISSION_ACK_DATA),
32162 #[doc = "Delete all mission items at once."]
32163 #[doc = ""]
32164 #[doc = "ID: 45"]
32165 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
32166 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
32167 #[doc = ""]
32168 #[doc = "ID: 44"]
32169 MISSION_COUNT(MISSION_COUNT_DATA),
32170 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
32171 #[doc = ""]
32172 #[doc = "ID: 42"]
32173 MISSION_CURRENT(MISSION_CURRENT_DATA),
32174 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32175 #[doc = ""]
32176 #[doc = "ID: 39"]
32177 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
32178 MISSION_ITEM(MISSION_ITEM_DATA),
32179 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32180 #[doc = ""]
32181 #[doc = "ID: 73"]
32182 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
32183 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
32184 #[doc = ""]
32185 #[doc = "ID: 46"]
32186 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
32187 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
32188 #[doc = ""]
32189 #[doc = "ID: 40"]
32190 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
32191 MISSION_REQUEST(MISSION_REQUEST_DATA),
32192 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
32193 #[doc = ""]
32194 #[doc = "ID: 51"]
32195 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
32196 #[doc = "Request the overall list of mission items from the system/component."]
32197 #[doc = ""]
32198 #[doc = "ID: 43"]
32199 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
32200 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
32201 #[doc = ""]
32202 #[doc = "ID: 37"]
32203 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
32204 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
32205 #[doc = ""]
32206 #[doc = "ID: 41"]
32207 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
32208 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
32209 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
32210 #[doc = ""]
32211 #[doc = "ID: 38"]
32212 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
32213 #[doc = "Orientation of a mount."]
32214 #[doc = ""]
32215 #[doc = "ID: 265"]
32216 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
32217 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
32218 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32219 #[doc = ""]
32220 #[doc = "ID: 251"]
32221 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
32222 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32223 #[doc = ""]
32224 #[doc = "ID: 252"]
32225 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
32226 #[doc = "The state of the navigation and position controller."]
32227 #[doc = ""]
32228 #[doc = "ID: 62"]
32229 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
32230 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
32231 #[doc = ""]
32232 #[doc = "ID: 330"]
32233 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
32234 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
32235 #[doc = ""]
32236 #[doc = "ID: 331"]
32237 ODOMETRY(ODOMETRY_DATA),
32238 #[doc = "Hardware status sent by an onboard computer."]
32239 #[doc = ""]
32240 #[doc = "ID: 390"]
32241 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
32242 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
32243 #[doc = ""]
32244 #[doc = "ID: 12918"]
32245 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
32246 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
32247 #[doc = ""]
32248 #[doc = "ID: 12902"]
32249 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
32250 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
32251 #[doc = ""]
32252 #[doc = "ID: 12900"]
32253 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
32254 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
32255 #[doc = ""]
32256 #[doc = "ID: 12901"]
32257 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
32258 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
32259 #[doc = ""]
32260 #[doc = "ID: 12915"]
32261 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
32262 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
32263 #[doc = ""]
32264 #[doc = "ID: 12905"]
32265 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
32266 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
32267 #[doc = ""]
32268 #[doc = "ID: 12903"]
32269 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
32270 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
32271 #[doc = ""]
32272 #[doc = "ID: 12904"]
32273 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
32274 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
32275 #[doc = ""]
32276 #[doc = "ID: 12919"]
32277 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
32278 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
32279 #[doc = ""]
32280 #[doc = "ID: 100"]
32281 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
32282 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
32283 #[doc = ""]
32284 #[doc = "ID: 106"]
32285 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
32286 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
32287 #[doc = ""]
32288 #[doc = "ID: 360"]
32289 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
32290 #[doc = "Response from a PARAM_EXT_SET message."]
32291 #[doc = ""]
32292 #[doc = "ID: 324"]
32293 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
32294 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
32295 #[doc = ""]
32296 #[doc = "ID: 321"]
32297 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
32298 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
32299 #[doc = ""]
32300 #[doc = "ID: 320"]
32301 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
32302 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
32303 #[doc = ""]
32304 #[doc = "ID: 323"]
32305 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
32306 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
32307 #[doc = ""]
32308 #[doc = "ID: 322"]
32309 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
32310 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
32311 #[doc = ""]
32312 #[doc = "ID: 50"]
32313 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
32314 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32315 #[doc = ""]
32316 #[doc = "ID: 21"]
32317 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
32318 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
32319 #[doc = ""]
32320 #[doc = "ID: 20"]
32321 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
32322 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32323 #[doc = ""]
32324 #[doc = "ID: 23"]
32325 PARAM_SET(PARAM_SET_DATA),
32326 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32327 #[doc = ""]
32328 #[doc = "ID: 22"]
32329 PARAM_VALUE(PARAM_VALUE_DATA),
32330 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
32331 #[doc = ""]
32332 #[doc = "ID: 4"]
32333 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
32334 PING(PING_DATA),
32335 #[doc = "Control vehicle tone generation (buzzer)."]
32336 #[doc = ""]
32337 #[doc = "ID: 258"]
32338 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
32339 PLAY_TUNE(PLAY_TUNE_DATA),
32340 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
32341 #[doc = ""]
32342 #[doc = "ID: 400"]
32343 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
32344 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
32345 #[doc = ""]
32346 #[doc = "ID: 87"]
32347 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
32348 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
32349 #[doc = ""]
32350 #[doc = "ID: 85"]
32351 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
32352 #[doc = "Power supply status."]
32353 #[doc = ""]
32354 #[doc = "ID: 125"]
32355 POWER_STATUS(POWER_STATUS_DATA),
32356 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
32357 #[doc = ""]
32358 #[doc = "ID: 300"]
32359 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
32360 #[doc = "Status generated by radio and injected into MAVLink stream."]
32361 #[doc = ""]
32362 #[doc = "ID: 109"]
32363 RADIO_STATUS(RADIO_STATUS_DATA),
32364 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
32365 #[doc = ""]
32366 #[doc = "ID: 27"]
32367 RAW_IMU(RAW_IMU_DATA),
32368 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
32369 #[doc = ""]
32370 #[doc = "ID: 28"]
32371 RAW_PRESSURE(RAW_PRESSURE_DATA),
32372 #[doc = "RPM sensor data message."]
32373 #[doc = ""]
32374 #[doc = "ID: 339"]
32375 RAW_RPM(RAW_RPM_DATA),
32376 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32377 #[doc = ""]
32378 #[doc = "ID: 65"]
32379 RC_CHANNELS(RC_CHANNELS_DATA),
32380 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
32381 #[doc = ""]
32382 #[doc = "ID: 70"]
32383 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
32384 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32385 #[doc = ""]
32386 #[doc = "ID: 35"]
32387 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
32388 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
32389 #[doc = ""]
32390 #[doc = "ID: 34"]
32391 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
32392 #[doc = "Request a data stream."]
32393 #[doc = ""]
32394 #[doc = "ID: 66"]
32395 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
32396 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
32397 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
32398 #[doc = ""]
32399 #[doc = "ID: 412"]
32400 REQUEST_EVENT(REQUEST_EVENT_DATA),
32401 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
32402 #[doc = ""]
32403 #[doc = "ID: 142"]
32404 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
32405 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
32406 #[doc = ""]
32407 #[doc = "ID: 413"]
32408 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
32409 #[doc = "Read out the safety zone the MAV currently assumes."]
32410 #[doc = ""]
32411 #[doc = "ID: 55"]
32412 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
32413 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
32414 #[doc = ""]
32415 #[doc = "ID: 54"]
32416 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
32417 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
32418 #[doc = ""]
32419 #[doc = "ID: 26"]
32420 SCALED_IMU(SCALED_IMU_DATA),
32421 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
32422 #[doc = ""]
32423 #[doc = "ID: 116"]
32424 SCALED_IMU2(SCALED_IMU2_DATA),
32425 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
32426 #[doc = ""]
32427 #[doc = "ID: 129"]
32428 SCALED_IMU3(SCALED_IMU3_DATA),
32429 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
32430 #[doc = ""]
32431 #[doc = "ID: 29"]
32432 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
32433 #[doc = "Barometer readings for 2nd barometer."]
32434 #[doc = ""]
32435 #[doc = "ID: 137"]
32436 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
32437 #[doc = "Barometer readings for 3rd barometer."]
32438 #[doc = ""]
32439 #[doc = "ID: 143"]
32440 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
32441 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
32442 #[doc = ""]
32443 #[doc = "ID: 126"]
32444 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
32445 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
32446 #[doc = ""]
32447 #[doc = "ID: 36"]
32448 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
32449 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
32450 #[doc = ""]
32451 #[doc = "ID: 256"]
32452 SETUP_SIGNING(SETUP_SIGNING_DATA),
32453 #[doc = "Set the vehicle attitude and body angular rates."]
32454 #[doc = ""]
32455 #[doc = "ID: 139"]
32456 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
32457 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
32458 #[doc = ""]
32459 #[doc = "ID: 82"]
32460 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
32461 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
32462 #[doc = ""]
32463 #[doc = "ID: 48"]
32464 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
32465 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
32466 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
32467 #[doc = ""]
32468 #[doc = "ID: 243"]
32469 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
32470 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
32471 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
32472 #[doc = ""]
32473 #[doc = "ID: 11"]
32474 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
32475 SET_MODE(SET_MODE_DATA),
32476 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
32477 #[doc = ""]
32478 #[doc = "ID: 86"]
32479 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
32480 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
32481 #[doc = ""]
32482 #[doc = "ID: 84"]
32483 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
32484 #[doc = "Status of simulation environment, if used."]
32485 #[doc = ""]
32486 #[doc = "ID: 108"]
32487 SIM_STATE(SIM_STATE_DATA),
32488 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
32489 #[doc = ""]
32490 #[doc = "ID: 370"]
32491 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
32492 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
32493 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
32494 #[doc = ""]
32495 #[doc = "ID: 253"]
32496 STATUSTEXT(STATUSTEXT_DATA),
32497 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
32498 #[doc = ""]
32499 #[doc = "ID: 261"]
32500 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
32501 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
32502 #[doc = ""]
32503 #[doc = "ID: 401"]
32504 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
32505 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
32506 #[doc = ""]
32507 #[doc = "ID: 2"]
32508 SYSTEM_TIME(SYSTEM_TIME_DATA),
32509 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
32510 #[doc = ""]
32511 #[doc = "ID: 1"]
32512 SYS_STATUS(SYS_STATUS_DATA),
32513 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
32514 #[doc = ""]
32515 #[doc = "ID: 135"]
32516 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
32517 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32518 #[doc = ""]
32519 #[doc = "ID: 134"]
32520 TERRAIN_DATA(TERRAIN_DATA_DATA),
32521 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32522 #[doc = ""]
32523 #[doc = "ID: 136"]
32524 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
32525 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32526 #[doc = ""]
32527 #[doc = "ID: 133"]
32528 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
32529 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
32530 #[doc = ""]
32531 #[doc = "ID: 111"]
32532 TIMESYNC(TIMESYNC_DATA),
32533 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
32534 #[doc = ""]
32535 #[doc = "ID: 380"]
32536 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
32537 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
32538 #[doc = ""]
32539 #[doc = "ID: 333"]
32540 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
32541 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
32542 #[doc = ""]
32543 #[doc = "ID: 332"]
32544 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
32545 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
32546 #[doc = ""]
32547 #[doc = "ID: 385"]
32548 TUNNEL(TUNNEL_DATA),
32549 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
32550 #[doc = ""]
32551 #[doc = "ID: 311"]
32552 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
32553 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
32554 #[doc = ""]
32555 #[doc = "ID: 310"]
32556 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
32557 #[doc = "The global position resulting from GPS and sensor fusion."]
32558 #[doc = ""]
32559 #[doc = "ID: 340"]
32560 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
32561 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
32562 #[doc = ""]
32563 #[doc = "ID: 248"]
32564 V2_EXTENSION(V2_EXTENSION_DATA),
32565 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
32566 #[doc = ""]
32567 #[doc = "ID: 74"]
32568 VFR_HUD(VFR_HUD_DATA),
32569 #[doc = "Vibration levels and accelerometer clipping."]
32570 #[doc = ""]
32571 #[doc = "ID: 241"]
32572 VIBRATION(VIBRATION_DATA),
32573 #[doc = "Global position estimate from a Vicon motion system source."]
32574 #[doc = ""]
32575 #[doc = "ID: 104"]
32576 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
32577 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
32578 #[doc = ""]
32579 #[doc = "ID: 269"]
32580 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
32581 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32582 #[doc = ""]
32583 #[doc = "ID: 270"]
32584 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
32585 #[doc = "Local position/attitude estimate from a vision source."]
32586 #[doc = ""]
32587 #[doc = "ID: 102"]
32588 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
32589 #[doc = "Speed estimate from a vision source."]
32590 #[doc = ""]
32591 #[doc = "ID: 103"]
32592 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
32593 #[doc = "Cumulative distance traveled for each reported wheel."]
32594 #[doc = ""]
32595 #[doc = "ID: 9000"]
32596 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
32597 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32598 #[doc = ""]
32599 #[doc = "ID: 299"]
32600 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
32601 #[doc = "Winch status."]
32602 #[doc = ""]
32603 #[doc = "ID: 9005"]
32604 WINCH_STATUS(WINCH_STATUS_DATA),
32605 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32606 #[doc = ""]
32607 #[doc = "ID: 231"]
32608 WIND_COV(WIND_COV_DATA),
32609}
32610impl MavMessage {
32611 pub const fn all_ids() -> &'static [u32] {
32612 &[
32613 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
32614 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
32615 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
32616 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
32617 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
32618 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
32619 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
32620 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
32621 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
32622 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
32623 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
32624 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
32625 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
32626 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
32627 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
32628 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
32629 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
32630 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
32631 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
32632 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
32633 12915u32, 12918u32, 12919u32, 12920u32, 50001u32, 50002u32, 50003u32, 50004u32,
32634 50005u32,
32635 ]
32636 }
32637}
32638impl Message for MavMessage {
32639 fn parse(
32640 version: MavlinkVersion,
32641 id: u32,
32642 payload: &[u8],
32643 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32644 match id {
32645 ACTUATOR_CONTROL_TARGET_DATA::ID => {
32646 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32647 .map(Self::ACTUATOR_CONTROL_TARGET)
32648 }
32649 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
32650 .map(Self::ACTUATOR_OUTPUT_STATUS),
32651 ADSB_VEHICLE_DATA::ID => {
32652 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
32653 }
32654 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
32655 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
32656 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
32657 ATTITUDE_QUATERNION_DATA::ID => {
32658 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
32659 }
32660 ATTITUDE_QUATERNION_COV_DATA::ID => {
32661 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
32662 .map(Self::ATTITUDE_QUATERNION_COV)
32663 }
32664 ATTITUDE_TARGET_DATA::ID => {
32665 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
32666 }
32667 ATT_POS_MOCAP_DATA::ID => {
32668 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
32669 }
32670 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
32671 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
32672 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
32673 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
32674 }
32675 AUTOPILOT_VERSION_DATA::ID => {
32676 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
32677 }
32678 AVAILABLE_MODES_DATA::ID => {
32679 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
32680 }
32681 AVAILABLE_MODES_MONITOR_DATA::ID => {
32682 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
32683 .map(Self::AVAILABLE_MODES_MONITOR)
32684 }
32685 BATTERY_INFO_DATA::ID => {
32686 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
32687 }
32688 BATTERY_STATUS_DATA::ID => {
32689 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
32690 }
32691 BUTTON_CHANGE_DATA::ID => {
32692 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
32693 }
32694 CAMERA_CAPTURE_STATUS_DATA::ID => {
32695 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
32696 }
32697 CAMERA_FOV_STATUS_DATA::ID => {
32698 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
32699 }
32700 CAMERA_IMAGE_CAPTURED_DATA::ID => {
32701 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
32702 }
32703 CAMERA_INFORMATION_DATA::ID => {
32704 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
32705 }
32706 CAMERA_SETTINGS_DATA::ID => {
32707 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
32708 }
32709 CAMERA_THERMAL_RANGE_DATA::ID => {
32710 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
32711 }
32712 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
32713 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
32714 .map(Self::CAMERA_TRACKING_GEO_STATUS)
32715 }
32716 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
32717 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
32718 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
32719 }
32720 CAMERA_TRIGGER_DATA::ID => {
32721 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
32722 }
32723 CANFD_FRAME_DATA::ID => {
32724 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
32725 }
32726 CAN_FILTER_MODIFY_DATA::ID => {
32727 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
32728 }
32729 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
32730 CELLULAR_CONFIG_DATA::ID => {
32731 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
32732 }
32733 CELLULAR_STATUS_DATA::ID => {
32734 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
32735 }
32736 CHANGE_OPERATOR_CONTROL_DATA::ID => {
32737 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
32738 .map(Self::CHANGE_OPERATOR_CONTROL)
32739 }
32740 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
32741 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
32742 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
32743 }
32744 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
32745 COMMAND_ACK_DATA::ID => {
32746 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
32747 }
32748 COMMAND_CANCEL_DATA::ID => {
32749 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
32750 }
32751 COMMAND_INT_DATA::ID => {
32752 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
32753 }
32754 COMMAND_LONG_DATA::ID => {
32755 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
32756 }
32757 COMPONENT_INFORMATION_DATA::ID => {
32758 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
32759 }
32760 COMPONENT_INFORMATION_BASIC_DATA::ID => {
32761 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
32762 .map(Self::COMPONENT_INFORMATION_BASIC)
32763 }
32764 COMPONENT_METADATA_DATA::ID => {
32765 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
32766 }
32767 CONTROL_SYSTEM_STATE_DATA::ID => {
32768 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
32769 }
32770 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
32771 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::deser(version, payload)
32772 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP)
32773 }
32774 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
32775 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::deser(version, payload)
32776 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_START)
32777 }
32778 CUBEPILOT_RAW_RC_DATA::ID => {
32779 CUBEPILOT_RAW_RC_DATA::deser(version, payload).map(Self::CUBEPILOT_RAW_RC)
32780 }
32781 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
32782 .map(Self::CURRENT_EVENT_SEQUENCE),
32783 CURRENT_MODE_DATA::ID => {
32784 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
32785 }
32786 DATA_STREAM_DATA::ID => {
32787 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
32788 }
32789 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
32790 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
32791 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
32792 }
32793 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
32794 DEBUG_FLOAT_ARRAY_DATA::ID => {
32795 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
32796 }
32797 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
32798 DISTANCE_SENSOR_DATA::ID => {
32799 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
32800 }
32801 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
32802 ENCAPSULATED_DATA_DATA::ID => {
32803 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
32804 }
32805 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
32806 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
32807 ESTIMATOR_STATUS_DATA::ID => {
32808 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
32809 }
32810 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
32811 EXTENDED_SYS_STATE_DATA::ID => {
32812 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
32813 }
32814 FENCE_STATUS_DATA::ID => {
32815 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
32816 }
32817 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
32818 .map(Self::FILE_TRANSFER_PROTOCOL),
32819 FLIGHT_INFORMATION_DATA::ID => {
32820 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
32821 }
32822 FOLLOW_TARGET_DATA::ID => {
32823 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
32824 }
32825 FUEL_STATUS_DATA::ID => {
32826 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
32827 }
32828 GENERATOR_STATUS_DATA::ID => {
32829 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
32830 }
32831 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
32832 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
32833 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
32834 }
32835 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
32836 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
32837 .map(Self::GIMBAL_DEVICE_INFORMATION)
32838 }
32839 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
32840 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
32841 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
32842 }
32843 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
32844 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
32845 .map(Self::GIMBAL_MANAGER_INFORMATION)
32846 }
32847 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
32848 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
32849 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
32850 }
32851 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
32852 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
32853 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
32854 }
32855 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
32856 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
32857 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
32858 }
32859 GIMBAL_MANAGER_STATUS_DATA::ID => {
32860 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
32861 }
32862 GLOBAL_POSITION_INT_DATA::ID => {
32863 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
32864 }
32865 GLOBAL_POSITION_INT_COV_DATA::ID => {
32866 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
32867 .map(Self::GLOBAL_POSITION_INT_COV)
32868 }
32869 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
32870 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32871 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
32872 }
32873 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
32874 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
32875 GPS_GLOBAL_ORIGIN_DATA::ID => {
32876 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
32877 }
32878 GPS_INJECT_DATA_DATA::ID => {
32879 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
32880 }
32881 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
32882 GPS_RAW_INT_DATA::ID => {
32883 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
32884 }
32885 GPS_RTCM_DATA_DATA::ID => {
32886 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
32887 }
32888 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
32889 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
32890 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
32891 HERELINK_TELEM_DATA::ID => {
32892 HERELINK_TELEM_DATA::deser(version, payload).map(Self::HERELINK_TELEM)
32893 }
32894 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
32895 HERELINK_VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
32896 .map(Self::HERELINK_VIDEO_STREAM_INFORMATION)
32897 }
32898 HIGHRES_IMU_DATA::ID => {
32899 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
32900 }
32901 HIGH_LATENCY_DATA::ID => {
32902 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
32903 }
32904 HIGH_LATENCY2_DATA::ID => {
32905 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
32906 }
32907 HIL_ACTUATOR_CONTROLS_DATA::ID => {
32908 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
32909 }
32910 HIL_CONTROLS_DATA::ID => {
32911 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
32912 }
32913 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
32914 HIL_OPTICAL_FLOW_DATA::ID => {
32915 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
32916 }
32917 HIL_RC_INPUTS_RAW_DATA::ID => {
32918 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
32919 }
32920 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
32921 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
32922 HIL_STATE_QUATERNION_DATA::ID => {
32923 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
32924 }
32925 HOME_POSITION_DATA::ID => {
32926 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
32927 }
32928 HYGROMETER_SENSOR_DATA::ID => {
32929 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
32930 }
32931 ILLUMINATOR_STATUS_DATA::ID => {
32932 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
32933 }
32934 ISBD_LINK_STATUS_DATA::ID => {
32935 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
32936 }
32937 LANDING_TARGET_DATA::ID => {
32938 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
32939 }
32940 LINK_NODE_STATUS_DATA::ID => {
32941 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
32942 }
32943 LOCAL_POSITION_NED_DATA::ID => {
32944 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
32945 }
32946 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
32947 .map(Self::LOCAL_POSITION_NED_COV),
32948 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
32949 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
32950 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
32951 }
32952 LOGGING_ACK_DATA::ID => {
32953 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
32954 }
32955 LOGGING_DATA_DATA::ID => {
32956 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
32957 }
32958 LOGGING_DATA_ACKED_DATA::ID => {
32959 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
32960 }
32961 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
32962 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
32963 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
32964 LOG_REQUEST_DATA_DATA::ID => {
32965 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
32966 }
32967 LOG_REQUEST_END_DATA::ID => {
32968 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
32969 }
32970 LOG_REQUEST_LIST_DATA::ID => {
32971 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
32972 }
32973 MAG_CAL_REPORT_DATA::ID => {
32974 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
32975 }
32976 MANUAL_CONTROL_DATA::ID => {
32977 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
32978 }
32979 MANUAL_SETPOINT_DATA::ID => {
32980 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
32981 }
32982 MEMORY_VECT_DATA::ID => {
32983 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
32984 }
32985 MESSAGE_INTERVAL_DATA::ID => {
32986 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
32987 }
32988 MISSION_ACK_DATA::ID => {
32989 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
32990 }
32991 MISSION_CLEAR_ALL_DATA::ID => {
32992 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
32993 }
32994 MISSION_COUNT_DATA::ID => {
32995 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
32996 }
32997 MISSION_CURRENT_DATA::ID => {
32998 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
32999 }
33000 MISSION_ITEM_DATA::ID => {
33001 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33002 }
33003 MISSION_ITEM_INT_DATA::ID => {
33004 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33005 }
33006 MISSION_ITEM_REACHED_DATA::ID => {
33007 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33008 }
33009 MISSION_REQUEST_DATA::ID => {
33010 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33011 }
33012 MISSION_REQUEST_INT_DATA::ID => {
33013 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33014 }
33015 MISSION_REQUEST_LIST_DATA::ID => {
33016 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33017 }
33018 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33019 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33020 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33021 }
33022 MISSION_SET_CURRENT_DATA::ID => {
33023 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33024 }
33025 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33026 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33027 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33028 }
33029 MOUNT_ORIENTATION_DATA::ID => {
33030 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33031 }
33032 NAMED_VALUE_FLOAT_DATA::ID => {
33033 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33034 }
33035 NAMED_VALUE_INT_DATA::ID => {
33036 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33037 }
33038 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33039 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33040 }
33041 OBSTACLE_DISTANCE_DATA::ID => {
33042 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33043 }
33044 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33045 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33046 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33047 .map(Self::ONBOARD_COMPUTER_STATUS)
33048 }
33049 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33050 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33051 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33052 }
33053 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33054 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33055 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33056 }
33057 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33058 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33059 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33060 .map(Self::OPEN_DRONE_ID_LOCATION),
33061 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33062 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33063 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33064 }
33065 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33066 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33067 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33068 }
33069 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33070 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33071 }
33072 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33073 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33074 }
33075 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33076 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33077 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33078 }
33079 OPTICAL_FLOW_DATA::ID => {
33080 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33081 }
33082 OPTICAL_FLOW_RAD_DATA::ID => {
33083 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33084 }
33085 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33086 .map(Self::ORBIT_EXECUTION_STATUS),
33087 PARAM_EXT_ACK_DATA::ID => {
33088 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33089 }
33090 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33091 .map(Self::PARAM_EXT_REQUEST_LIST),
33092 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33093 .map(Self::PARAM_EXT_REQUEST_READ),
33094 PARAM_EXT_SET_DATA::ID => {
33095 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33096 }
33097 PARAM_EXT_VALUE_DATA::ID => {
33098 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33099 }
33100 PARAM_MAP_RC_DATA::ID => {
33101 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33102 }
33103 PARAM_REQUEST_LIST_DATA::ID => {
33104 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33105 }
33106 PARAM_REQUEST_READ_DATA::ID => {
33107 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33108 }
33109 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33110 PARAM_VALUE_DATA::ID => {
33111 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33112 }
33113 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33114 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33115 PLAY_TUNE_V2_DATA::ID => {
33116 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33117 }
33118 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33119 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33120 .map(Self::POSITION_TARGET_GLOBAL_INT)
33121 }
33122 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33123 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33124 .map(Self::POSITION_TARGET_LOCAL_NED)
33125 }
33126 POWER_STATUS_DATA::ID => {
33127 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33128 }
33129 PROTOCOL_VERSION_DATA::ID => {
33130 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33131 }
33132 RADIO_STATUS_DATA::ID => {
33133 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33134 }
33135 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33136 RAW_PRESSURE_DATA::ID => {
33137 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33138 }
33139 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33140 RC_CHANNELS_DATA::ID => {
33141 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33142 }
33143 RC_CHANNELS_OVERRIDE_DATA::ID => {
33144 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33145 }
33146 RC_CHANNELS_RAW_DATA::ID => {
33147 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33148 }
33149 RC_CHANNELS_SCALED_DATA::ID => {
33150 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33151 }
33152 REQUEST_DATA_STREAM_DATA::ID => {
33153 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33154 }
33155 REQUEST_EVENT_DATA::ID => {
33156 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33157 }
33158 RESOURCE_REQUEST_DATA::ID => {
33159 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33160 }
33161 RESPONSE_EVENT_ERROR_DATA::ID => {
33162 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33163 }
33164 SAFETY_ALLOWED_AREA_DATA::ID => {
33165 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33166 }
33167 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33168 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33169 .map(Self::SAFETY_SET_ALLOWED_AREA)
33170 }
33171 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33172 SCALED_IMU2_DATA::ID => {
33173 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33174 }
33175 SCALED_IMU3_DATA::ID => {
33176 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33177 }
33178 SCALED_PRESSURE_DATA::ID => {
33179 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33180 }
33181 SCALED_PRESSURE2_DATA::ID => {
33182 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33183 }
33184 SCALED_PRESSURE3_DATA::ID => {
33185 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33186 }
33187 SERIAL_CONTROL_DATA::ID => {
33188 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33189 }
33190 SERVO_OUTPUT_RAW_DATA::ID => {
33191 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33192 }
33193 SETUP_SIGNING_DATA::ID => {
33194 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
33195 }
33196 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
33197 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33198 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
33199 }
33200 SET_ATTITUDE_TARGET_DATA::ID => {
33201 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
33202 }
33203 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
33204 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
33205 }
33206 SET_HOME_POSITION_DATA::ID => {
33207 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
33208 }
33209 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
33210 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33211 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33212 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
33213 }
33214 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
33215 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33216 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
33217 }
33218 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
33219 SMART_BATTERY_INFO_DATA::ID => {
33220 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
33221 }
33222 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
33223 STORAGE_INFORMATION_DATA::ID => {
33224 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
33225 }
33226 SUPPORTED_TUNES_DATA::ID => {
33227 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
33228 }
33229 SYSTEM_TIME_DATA::ID => {
33230 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
33231 }
33232 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
33233 TERRAIN_CHECK_DATA::ID => {
33234 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
33235 }
33236 TERRAIN_DATA_DATA::ID => {
33237 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
33238 }
33239 TERRAIN_REPORT_DATA::ID => {
33240 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
33241 }
33242 TERRAIN_REQUEST_DATA::ID => {
33243 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
33244 }
33245 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
33246 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
33247 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
33248 .map(Self::TIME_ESTIMATE_TO_TARGET)
33249 }
33250 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33251 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
33252 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
33253 }
33254 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33255 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
33256 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
33257 }
33258 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
33259 UAVCAN_NODE_INFO_DATA::ID => {
33260 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
33261 }
33262 UAVCAN_NODE_STATUS_DATA::ID => {
33263 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
33264 }
33265 UTM_GLOBAL_POSITION_DATA::ID => {
33266 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
33267 }
33268 V2_EXTENSION_DATA::ID => {
33269 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
33270 }
33271 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
33272 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
33273 VICON_POSITION_ESTIMATE_DATA::ID => {
33274 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
33275 .map(Self::VICON_POSITION_ESTIMATE)
33276 }
33277 VIDEO_STREAM_INFORMATION_DATA::ID => {
33278 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33279 .map(Self::VIDEO_STREAM_INFORMATION)
33280 }
33281 VIDEO_STREAM_STATUS_DATA::ID => {
33282 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
33283 }
33284 VISION_POSITION_ESTIMATE_DATA::ID => {
33285 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33286 .map(Self::VISION_POSITION_ESTIMATE)
33287 }
33288 VISION_SPEED_ESTIMATE_DATA::ID => {
33289 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
33290 }
33291 WHEEL_DISTANCE_DATA::ID => {
33292 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
33293 }
33294 WIFI_CONFIG_AP_DATA::ID => {
33295 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
33296 }
33297 WINCH_STATUS_DATA::ID => {
33298 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
33299 }
33300 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
33301 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
33302 }
33303 }
33304 fn message_name(&self) -> &'static str {
33305 match self {
33306 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
33307 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
33308 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
33309 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
33310 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
33311 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
33312 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
33313 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
33314 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
33315 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
33316 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
33317 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33318 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
33319 }
33320 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
33321 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
33322 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
33323 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
33324 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
33325 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
33326 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
33327 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
33328 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
33329 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
33330 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
33331 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
33332 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
33333 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
33334 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
33335 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
33336 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
33337 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
33338 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
33339 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
33340 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
33341 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
33342 Self::COLLISION(..) => COLLISION_DATA::NAME,
33343 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
33344 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
33345 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
33346 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
33347 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
33348 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
33349 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
33350 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
33351 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME,
33352 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME,
33353 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::NAME,
33354 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
33355 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
33356 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
33357 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
33358 Self::DEBUG(..) => DEBUG_DATA::NAME,
33359 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
33360 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
33361 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
33362 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
33363 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
33364 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
33365 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
33366 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
33367 Self::EVENT(..) => EVENT_DATA::NAME,
33368 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
33369 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
33370 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
33371 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
33372 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
33373 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
33374 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
33375 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
33376 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
33377 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
33378 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
33379 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
33380 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33381 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
33382 }
33383 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
33384 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
33385 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
33386 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
33387 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
33388 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
33389 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
33390 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
33391 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
33392 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
33393 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
33394 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
33395 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
33396 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
33397 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
33398 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::NAME,
33399 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
33400 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME
33401 }
33402 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
33403 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
33404 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
33405 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
33406 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
33407 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
33408 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
33409 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
33410 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
33411 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
33412 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
33413 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
33414 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
33415 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
33416 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
33417 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
33418 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
33419 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
33420 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
33421 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33422 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
33423 }
33424 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
33425 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
33426 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
33427 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
33428 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
33429 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
33430 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
33431 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
33432 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
33433 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
33434 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
33435 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
33436 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
33437 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
33438 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
33439 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
33440 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
33441 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
33442 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
33443 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
33444 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
33445 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
33446 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
33447 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
33448 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
33449 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
33450 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
33451 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
33452 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
33453 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
33454 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
33455 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
33456 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
33457 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
33458 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
33459 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
33460 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
33461 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
33462 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
33463 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
33464 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
33465 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
33466 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
33467 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
33468 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
33469 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
33470 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
33471 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
33472 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
33473 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
33474 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
33475 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
33476 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
33477 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
33478 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
33479 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
33480 Self::PING(..) => PING_DATA::NAME,
33481 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
33482 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
33483 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33484 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
33485 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
33486 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
33487 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
33488 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
33489 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
33490 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
33491 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
33492 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
33493 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
33494 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
33495 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
33496 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
33497 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
33498 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
33499 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
33500 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
33501 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
33502 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
33503 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
33504 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
33505 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
33506 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
33507 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
33508 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
33509 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
33510 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
33511 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
33512 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
33513 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
33514 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
33515 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33516 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
33517 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
33518 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
33519 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
33520 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
33521 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
33522 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
33523 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
33524 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
33525 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
33526 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
33527 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
33528 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
33529 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
33530 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
33531 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
33532 }
33533 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33534 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
33535 }
33536 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
33537 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
33538 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
33539 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
33540 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
33541 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
33542 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
33543 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
33544 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
33545 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
33546 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
33547 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
33548 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
33549 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
33550 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
33551 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
33552 }
33553 }
33554 fn message_id(&self) -> u32 {
33555 match self {
33556 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
33557 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
33558 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
33559 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
33560 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
33561 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
33562 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
33563 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
33564 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
33565 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
33566 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
33567 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33568 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
33569 }
33570 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
33571 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
33572 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
33573 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
33574 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
33575 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
33576 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
33577 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
33578 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
33579 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
33580 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
33581 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
33582 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
33583 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
33584 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
33585 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
33586 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
33587 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
33588 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
33589 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
33590 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
33591 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
33592 Self::COLLISION(..) => COLLISION_DATA::ID,
33593 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
33594 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
33595 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
33596 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
33597 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
33598 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
33599 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
33600 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
33601 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID,
33602 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID,
33603 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::ID,
33604 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
33605 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
33606 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
33607 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
33608 Self::DEBUG(..) => DEBUG_DATA::ID,
33609 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
33610 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
33611 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
33612 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
33613 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
33614 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
33615 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
33616 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
33617 Self::EVENT(..) => EVENT_DATA::ID,
33618 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
33619 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
33620 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
33621 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
33622 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
33623 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
33624 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
33625 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
33626 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
33627 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
33628 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
33629 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
33630 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33631 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
33632 }
33633 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
33634 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
33635 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
33636 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
33637 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
33638 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
33639 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
33640 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
33641 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
33642 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
33643 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
33644 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
33645 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
33646 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
33647 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
33648 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::ID,
33649 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
33650 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID
33651 }
33652 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
33653 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
33654 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
33655 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
33656 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
33657 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
33658 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
33659 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
33660 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
33661 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
33662 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
33663 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
33664 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
33665 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
33666 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
33667 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
33668 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
33669 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
33670 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
33671 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33672 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
33673 }
33674 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
33675 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
33676 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
33677 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
33678 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
33679 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
33680 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
33681 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
33682 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
33683 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
33684 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
33685 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
33686 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
33687 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
33688 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
33689 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
33690 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
33691 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
33692 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
33693 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
33694 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
33695 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
33696 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
33697 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
33698 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
33699 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
33700 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
33701 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
33702 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
33703 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
33704 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
33705 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
33706 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
33707 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
33708 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
33709 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
33710 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
33711 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
33712 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
33713 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
33714 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
33715 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
33716 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
33717 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
33718 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
33719 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
33720 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
33721 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
33722 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
33723 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
33724 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
33725 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
33726 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
33727 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
33728 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
33729 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
33730 Self::PING(..) => PING_DATA::ID,
33731 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
33732 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
33733 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
33734 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
33735 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
33736 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
33737 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
33738 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
33739 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
33740 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
33741 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
33742 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
33743 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
33744 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
33745 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
33746 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
33747 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
33748 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
33749 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
33750 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
33751 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
33752 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
33753 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
33754 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
33755 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
33756 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
33757 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
33758 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
33759 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
33760 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
33761 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
33762 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
33763 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
33764 Self::SET_MODE(..) => SET_MODE_DATA::ID,
33765 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
33766 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
33767 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
33768 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
33769 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
33770 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
33771 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
33772 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
33773 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
33774 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
33775 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
33776 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
33777 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
33778 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
33779 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
33780 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
33781 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33782 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
33783 }
33784 Self::TUNNEL(..) => TUNNEL_DATA::ID,
33785 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
33786 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
33787 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
33788 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
33789 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
33790 Self::VIBRATION(..) => VIBRATION_DATA::ID,
33791 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
33792 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
33793 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
33794 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
33795 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
33796 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
33797 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
33798 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
33799 Self::WIND_COV(..) => WIND_COV_DATA::ID,
33800 }
33801 }
33802 fn message_id_from_name(name: &str) -> Option<u32> {
33803 match name {
33804 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
33805 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
33806 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
33807 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
33808 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
33809 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
33810 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
33811 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
33812 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
33813 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
33814 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
33815 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
33816 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
33817 }
33818 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
33819 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
33820 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
33821 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
33822 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
33823 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
33824 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
33825 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
33826 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
33827 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
33828 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
33829 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
33830 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
33831 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
33832 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
33833 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
33834 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
33835 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
33836 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
33837 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
33838 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
33839 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
33840 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
33841 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
33842 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
33843 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
33844 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
33845 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
33846 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
33847 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
33848 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
33849 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME => {
33850 Some(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID)
33851 }
33852 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME => {
33853 Some(CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID)
33854 }
33855 CUBEPILOT_RAW_RC_DATA::NAME => Some(CUBEPILOT_RAW_RC_DATA::ID),
33856 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
33857 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
33858 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
33859 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
33860 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
33861 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
33862 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
33863 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
33864 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
33865 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
33866 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
33867 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
33868 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
33869 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
33870 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
33871 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
33872 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
33873 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
33874 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
33875 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
33876 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
33877 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
33878 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
33879 }
33880 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
33881 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
33882 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
33883 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
33884 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
33885 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
33886 }
33887 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
33888 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
33889 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
33890 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
33891 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
33892 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
33893 }
33894 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
33895 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
33896 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
33897 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
33898 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
33899 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
33900 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
33901 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
33902 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
33903 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
33904 HERELINK_TELEM_DATA::NAME => Some(HERELINK_TELEM_DATA::ID),
33905 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME => {
33906 Some(HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID)
33907 }
33908 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
33909 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
33910 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
33911 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
33912 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
33913 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
33914 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
33915 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
33916 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
33917 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
33918 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
33919 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
33920 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
33921 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
33922 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
33923 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
33924 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
33925 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
33926 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
33927 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
33928 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
33929 }
33930 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
33931 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
33932 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
33933 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
33934 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
33935 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
33936 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
33937 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
33938 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
33939 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
33940 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
33941 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
33942 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
33943 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
33944 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
33945 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
33946 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
33947 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
33948 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
33949 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
33950 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
33951 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
33952 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
33953 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
33954 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
33955 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
33956 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
33957 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
33958 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
33959 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
33960 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
33961 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
33962 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
33963 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
33964 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
33965 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
33966 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
33967 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
33968 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
33969 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
33970 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
33971 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
33972 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
33973 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
33974 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
33975 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
33976 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
33977 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
33978 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
33979 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
33980 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
33981 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
33982 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
33983 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
33984 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
33985 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
33986 PING_DATA::NAME => Some(PING_DATA::ID),
33987 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
33988 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
33989 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
33990 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
33991 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
33992 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
33993 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
33994 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
33995 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
33996 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
33997 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
33998 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
33999 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34000 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34001 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34002 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34003 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34004 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34005 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34006 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34007 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34008 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34009 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34010 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34011 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34012 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34013 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34014 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34015 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34016 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34017 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34018 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34019 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34020 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34021 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34022 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34023 }
34024 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34025 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34026 }
34027 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34028 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34029 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34030 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34031 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34032 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34033 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34034 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34035 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34036 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34037 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34038 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34039 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34040 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34041 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34042 }
34043 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34044 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34045 }
34046 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34047 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34048 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34049 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34050 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34051 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34052 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34053 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34054 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34055 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34056 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34057 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34058 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34059 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34060 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34061 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34062 _ => None,
34063 }
34064 }
34065 fn default_message_from_id(id: u32) -> Option<Self> {
34066 match id {
34067 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34068 ACTUATOR_CONTROL_TARGET_DATA::default(),
34069 )),
34070 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34071 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34072 )),
34073 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34074 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34075 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34076 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34077 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34078 ATTITUDE_QUATERNION_DATA::default(),
34079 )),
34080 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34081 ATTITUDE_QUATERNION_COV_DATA::default(),
34082 )),
34083 ATTITUDE_TARGET_DATA::ID => {
34084 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34085 }
34086 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34087 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34088 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34089 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34090 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34091 ))
34092 }
34093 AUTOPILOT_VERSION_DATA::ID => {
34094 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34095 }
34096 AVAILABLE_MODES_DATA::ID => {
34097 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34098 }
34099 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34100 AVAILABLE_MODES_MONITOR_DATA::default(),
34101 )),
34102 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34103 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34104 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34105 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34106 CAMERA_CAPTURE_STATUS_DATA::default(),
34107 )),
34108 CAMERA_FOV_STATUS_DATA::ID => {
34109 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34110 }
34111 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34112 CAMERA_IMAGE_CAPTURED_DATA::default(),
34113 )),
34114 CAMERA_INFORMATION_DATA::ID => {
34115 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
34116 }
34117 CAMERA_SETTINGS_DATA::ID => {
34118 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34119 }
34120 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34121 CAMERA_THERMAL_RANGE_DATA::default(),
34122 )),
34123 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34124 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
34125 )),
34126 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34127 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34128 )),
34129 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34130 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
34131 CAN_FILTER_MODIFY_DATA::ID => {
34132 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
34133 }
34134 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
34135 CELLULAR_CONFIG_DATA::ID => {
34136 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
34137 }
34138 CELLULAR_STATUS_DATA::ID => {
34139 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
34140 }
34141 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34142 CHANGE_OPERATOR_CONTROL_DATA::default(),
34143 )),
34144 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34145 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34146 )),
34147 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
34148 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34149 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34150 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
34151 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
34152 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34153 COMPONENT_INFORMATION_DATA::default(),
34154 )),
34155 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34156 COMPONENT_INFORMATION_BASIC_DATA::default(),
34157 )),
34158 COMPONENT_METADATA_DATA::ID => {
34159 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
34160 }
34161 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34162 CONTROL_SYSTEM_STATE_DATA::default(),
34163 )),
34164 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
34165 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::default(),
34166 )),
34167 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
34168 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
34169 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::default(),
34170 ))
34171 }
34172 CUBEPILOT_RAW_RC_DATA::ID => {
34173 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::default()))
34174 }
34175 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34176 CURRENT_EVENT_SEQUENCE_DATA::default(),
34177 )),
34178 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
34179 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
34180 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34181 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
34182 )),
34183 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
34184 DEBUG_FLOAT_ARRAY_DATA::ID => {
34185 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34186 }
34187 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
34188 DISTANCE_SENSOR_DATA::ID => {
34189 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34190 }
34191 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34192 ENCAPSULATED_DATA_DATA::ID => {
34193 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
34194 }
34195 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
34196 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34197 ESTIMATOR_STATUS_DATA::ID => {
34198 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34199 }
34200 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
34201 EXTENDED_SYS_STATE_DATA::ID => {
34202 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
34203 }
34204 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34205 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34206 FILE_TRANSFER_PROTOCOL_DATA::default(),
34207 )),
34208 FLIGHT_INFORMATION_DATA::ID => {
34209 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
34210 }
34211 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
34212 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
34213 GENERATOR_STATUS_DATA::ID => {
34214 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34215 }
34216 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34217 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34218 )),
34219 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34220 GIMBAL_DEVICE_INFORMATION_DATA::default(),
34221 )),
34222 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34223 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
34224 )),
34225 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34226 GIMBAL_MANAGER_INFORMATION_DATA::default(),
34227 )),
34228 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34229 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
34230 )),
34231 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34232 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34233 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
34234 ))
34235 }
34236 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34237 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
34238 )),
34239 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34240 GIMBAL_MANAGER_STATUS_DATA::default(),
34241 )),
34242 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34243 GLOBAL_POSITION_INT_DATA::default(),
34244 )),
34245 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34246 GLOBAL_POSITION_INT_COV_DATA::default(),
34247 )),
34248 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34249 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34250 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
34251 ))
34252 }
34253 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
34254 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
34255 GPS_GLOBAL_ORIGIN_DATA::ID => {
34256 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
34257 }
34258 GPS_INJECT_DATA_DATA::ID => {
34259 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
34260 }
34261 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
34262 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
34263 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
34264 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
34265 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
34266 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
34267 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::default())),
34268 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
34269 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
34270 HERELINK_VIDEO_STREAM_INFORMATION_DATA::default(),
34271 ))
34272 }
34273 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
34274 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
34275 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
34276 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34277 HIL_ACTUATOR_CONTROLS_DATA::default(),
34278 )),
34279 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
34280 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
34281 HIL_OPTICAL_FLOW_DATA::ID => {
34282 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
34283 }
34284 HIL_RC_INPUTS_RAW_DATA::ID => {
34285 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
34286 }
34287 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
34288 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
34289 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34290 HIL_STATE_QUATERNION_DATA::default(),
34291 )),
34292 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
34293 HYGROMETER_SENSOR_DATA::ID => {
34294 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
34295 }
34296 ILLUMINATOR_STATUS_DATA::ID => {
34297 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
34298 }
34299 ISBD_LINK_STATUS_DATA::ID => {
34300 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
34301 }
34302 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
34303 LINK_NODE_STATUS_DATA::ID => {
34304 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
34305 }
34306 LOCAL_POSITION_NED_DATA::ID => {
34307 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
34308 }
34309 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34310 LOCAL_POSITION_NED_COV_DATA::default(),
34311 )),
34312 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34313 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34314 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
34315 ))
34316 }
34317 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
34318 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
34319 LOGGING_DATA_ACKED_DATA::ID => {
34320 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
34321 }
34322 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
34323 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
34324 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
34325 LOG_REQUEST_DATA_DATA::ID => {
34326 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
34327 }
34328 LOG_REQUEST_END_DATA::ID => {
34329 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
34330 }
34331 LOG_REQUEST_LIST_DATA::ID => {
34332 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
34333 }
34334 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
34335 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
34336 MANUAL_SETPOINT_DATA::ID => {
34337 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
34338 }
34339 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
34340 MESSAGE_INTERVAL_DATA::ID => {
34341 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
34342 }
34343 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
34344 MISSION_CLEAR_ALL_DATA::ID => {
34345 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
34346 }
34347 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
34348 MISSION_CURRENT_DATA::ID => {
34349 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
34350 }
34351 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
34352 MISSION_ITEM_INT_DATA::ID => {
34353 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
34354 }
34355 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34356 MISSION_ITEM_REACHED_DATA::default(),
34357 )),
34358 MISSION_REQUEST_DATA::ID => {
34359 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
34360 }
34361 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34362 MISSION_REQUEST_INT_DATA::default(),
34363 )),
34364 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34365 MISSION_REQUEST_LIST_DATA::default(),
34366 )),
34367 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34368 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
34369 )),
34370 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34371 MISSION_SET_CURRENT_DATA::default(),
34372 )),
34373 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34374 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
34375 )),
34376 MOUNT_ORIENTATION_DATA::ID => {
34377 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
34378 }
34379 NAMED_VALUE_FLOAT_DATA::ID => {
34380 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
34381 }
34382 NAMED_VALUE_INT_DATA::ID => {
34383 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
34384 }
34385 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34386 NAV_CONTROLLER_OUTPUT_DATA::default(),
34387 )),
34388 OBSTACLE_DISTANCE_DATA::ID => {
34389 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
34390 }
34391 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
34392 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34393 ONBOARD_COMPUTER_STATUS_DATA::default(),
34394 )),
34395 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34396 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
34397 )),
34398 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34399 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
34400 )),
34401 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34402 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
34403 )),
34404 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34405 OPEN_DRONE_ID_LOCATION_DATA::default(),
34406 )),
34407 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34408 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
34409 )),
34410 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34411 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
34412 )),
34413 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34414 OPEN_DRONE_ID_SELF_ID_DATA::default(),
34415 )),
34416 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34417 OPEN_DRONE_ID_SYSTEM_DATA::default(),
34418 )),
34419 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34420 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
34421 )),
34422 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
34423 OPTICAL_FLOW_RAD_DATA::ID => {
34424 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
34425 }
34426 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34427 ORBIT_EXECUTION_STATUS_DATA::default(),
34428 )),
34429 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
34430 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34431 PARAM_EXT_REQUEST_LIST_DATA::default(),
34432 )),
34433 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34434 PARAM_EXT_REQUEST_READ_DATA::default(),
34435 )),
34436 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
34437 PARAM_EXT_VALUE_DATA::ID => {
34438 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
34439 }
34440 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
34441 PARAM_REQUEST_LIST_DATA::ID => {
34442 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
34443 }
34444 PARAM_REQUEST_READ_DATA::ID => {
34445 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
34446 }
34447 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
34448 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
34449 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
34450 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
34451 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
34452 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34453 POSITION_TARGET_GLOBAL_INT_DATA::default(),
34454 )),
34455 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34456 POSITION_TARGET_LOCAL_NED_DATA::default(),
34457 )),
34458 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
34459 PROTOCOL_VERSION_DATA::ID => {
34460 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
34461 }
34462 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
34463 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
34464 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
34465 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
34466 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
34467 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34468 RC_CHANNELS_OVERRIDE_DATA::default(),
34469 )),
34470 RC_CHANNELS_RAW_DATA::ID => {
34471 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
34472 }
34473 RC_CHANNELS_SCALED_DATA::ID => {
34474 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
34475 }
34476 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34477 REQUEST_DATA_STREAM_DATA::default(),
34478 )),
34479 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
34480 RESOURCE_REQUEST_DATA::ID => {
34481 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
34482 }
34483 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34484 RESPONSE_EVENT_ERROR_DATA::default(),
34485 )),
34486 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34487 SAFETY_ALLOWED_AREA_DATA::default(),
34488 )),
34489 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34490 SAFETY_SET_ALLOWED_AREA_DATA::default(),
34491 )),
34492 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
34493 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
34494 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
34495 SCALED_PRESSURE_DATA::ID => {
34496 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
34497 }
34498 SCALED_PRESSURE2_DATA::ID => {
34499 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
34500 }
34501 SCALED_PRESSURE3_DATA::ID => {
34502 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
34503 }
34504 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
34505 SERVO_OUTPUT_RAW_DATA::ID => {
34506 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
34507 }
34508 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
34509 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34510 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
34511 )),
34512 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34513 SET_ATTITUDE_TARGET_DATA::default(),
34514 )),
34515 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34516 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
34517 )),
34518 SET_HOME_POSITION_DATA::ID => {
34519 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
34520 }
34521 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
34522 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34523 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
34524 )),
34525 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34526 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
34527 )),
34528 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
34529 SMART_BATTERY_INFO_DATA::ID => {
34530 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
34531 }
34532 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
34533 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34534 STORAGE_INFORMATION_DATA::default(),
34535 )),
34536 SUPPORTED_TUNES_DATA::ID => {
34537 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
34538 }
34539 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
34540 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
34541 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
34542 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
34543 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
34544 TERRAIN_REQUEST_DATA::ID => {
34545 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
34546 }
34547 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
34548 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34549 TIME_ESTIMATE_TO_TARGET_DATA::default(),
34550 )),
34551 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34552 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34553 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
34554 ))
34555 }
34556 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34557 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34558 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
34559 ))
34560 }
34561 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
34562 UAVCAN_NODE_INFO_DATA::ID => {
34563 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
34564 }
34565 UAVCAN_NODE_STATUS_DATA::ID => {
34566 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
34567 }
34568 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34569 UTM_GLOBAL_POSITION_DATA::default(),
34570 )),
34571 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
34572 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
34573 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
34574 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34575 VICON_POSITION_ESTIMATE_DATA::default(),
34576 )),
34577 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34578 VIDEO_STREAM_INFORMATION_DATA::default(),
34579 )),
34580 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34581 VIDEO_STREAM_STATUS_DATA::default(),
34582 )),
34583 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34584 VISION_POSITION_ESTIMATE_DATA::default(),
34585 )),
34586 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34587 VISION_SPEED_ESTIMATE_DATA::default(),
34588 )),
34589 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
34590 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
34591 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
34592 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
34593 _ => None,
34594 }
34595 }
34596 #[cfg(feature = "arbitrary")]
34597 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
34598 match id {
34599 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34600 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34601 )),
34602 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34603 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
34604 )),
34605 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
34606 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
34607 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
34608 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
34609 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34610 ATTITUDE_QUATERNION_DATA::random(rng),
34611 )),
34612 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34613 ATTITUDE_QUATERNION_COV_DATA::random(rng),
34614 )),
34615 ATTITUDE_TARGET_DATA::ID => {
34616 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
34617 }
34618 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
34619 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
34620 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34621 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34622 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
34623 ))
34624 }
34625 AUTOPILOT_VERSION_DATA::ID => {
34626 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
34627 }
34628 AVAILABLE_MODES_DATA::ID => {
34629 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
34630 }
34631 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34632 AVAILABLE_MODES_MONITOR_DATA::random(rng),
34633 )),
34634 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
34635 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
34636 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
34637 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34638 CAMERA_CAPTURE_STATUS_DATA::random(rng),
34639 )),
34640 CAMERA_FOV_STATUS_DATA::ID => {
34641 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
34642 }
34643 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34644 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
34645 )),
34646 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
34647 CAMERA_INFORMATION_DATA::random(rng),
34648 )),
34649 CAMERA_SETTINGS_DATA::ID => {
34650 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
34651 }
34652 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34653 CAMERA_THERMAL_RANGE_DATA::random(rng),
34654 )),
34655 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34656 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
34657 )),
34658 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34659 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
34660 )),
34661 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
34662 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
34663 CAN_FILTER_MODIFY_DATA::ID => {
34664 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
34665 }
34666 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
34667 CELLULAR_CONFIG_DATA::ID => {
34668 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
34669 }
34670 CELLULAR_STATUS_DATA::ID => {
34671 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
34672 }
34673 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34674 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
34675 )),
34676 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34677 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
34678 )),
34679 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
34680 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
34681 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
34682 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
34683 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
34684 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34685 COMPONENT_INFORMATION_DATA::random(rng),
34686 )),
34687 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34688 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
34689 )),
34690 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
34691 COMPONENT_METADATA_DATA::random(rng),
34692 )),
34693 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34694 CONTROL_SYSTEM_STATE_DATA::random(rng),
34695 )),
34696 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
34697 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::random(rng),
34698 )),
34699 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
34700 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
34701 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::random(rng),
34702 ))
34703 }
34704 CUBEPILOT_RAW_RC_DATA::ID => {
34705 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::random(rng)))
34706 }
34707 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34708 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
34709 )),
34710 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
34711 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
34712 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34713 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
34714 )),
34715 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
34716 DEBUG_FLOAT_ARRAY_DATA::ID => {
34717 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
34718 }
34719 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
34720 DISTANCE_SENSOR_DATA::ID => {
34721 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
34722 }
34723 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
34724 ENCAPSULATED_DATA_DATA::ID => {
34725 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
34726 }
34727 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
34728 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
34729 ESTIMATOR_STATUS_DATA::ID => {
34730 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
34731 }
34732 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
34733 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
34734 EXTENDED_SYS_STATE_DATA::random(rng),
34735 )),
34736 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
34737 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34738 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
34739 )),
34740 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
34741 FLIGHT_INFORMATION_DATA::random(rng),
34742 )),
34743 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
34744 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
34745 GENERATOR_STATUS_DATA::ID => {
34746 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
34747 }
34748 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34749 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
34750 )),
34751 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34752 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
34753 )),
34754 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34755 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
34756 )),
34757 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34758 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
34759 )),
34760 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34761 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
34762 )),
34763 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34764 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34765 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
34766 ))
34767 }
34768 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34769 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
34770 )),
34771 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34772 GIMBAL_MANAGER_STATUS_DATA::random(rng),
34773 )),
34774 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34775 GLOBAL_POSITION_INT_DATA::random(rng),
34776 )),
34777 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34778 GLOBAL_POSITION_INT_COV_DATA::random(rng),
34779 )),
34780 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34781 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34782 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
34783 ))
34784 }
34785 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
34786 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
34787 GPS_GLOBAL_ORIGIN_DATA::ID => {
34788 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
34789 }
34790 GPS_INJECT_DATA_DATA::ID => {
34791 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
34792 }
34793 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
34794 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
34795 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
34796 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
34797 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
34798 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
34799 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::random(rng))),
34800 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
34801 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
34802 HERELINK_VIDEO_STREAM_INFORMATION_DATA::random(rng),
34803 ))
34804 }
34805 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
34806 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
34807 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
34808 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34809 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
34810 )),
34811 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
34812 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
34813 HIL_OPTICAL_FLOW_DATA::ID => {
34814 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
34815 }
34816 HIL_RC_INPUTS_RAW_DATA::ID => {
34817 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
34818 }
34819 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
34820 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
34821 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34822 HIL_STATE_QUATERNION_DATA::random(rng),
34823 )),
34824 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
34825 HYGROMETER_SENSOR_DATA::ID => {
34826 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
34827 }
34828 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
34829 ILLUMINATOR_STATUS_DATA::random(rng),
34830 )),
34831 ISBD_LINK_STATUS_DATA::ID => {
34832 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
34833 }
34834 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
34835 LINK_NODE_STATUS_DATA::ID => {
34836 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
34837 }
34838 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
34839 LOCAL_POSITION_NED_DATA::random(rng),
34840 )),
34841 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34842 LOCAL_POSITION_NED_COV_DATA::random(rng),
34843 )),
34844 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34845 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34846 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
34847 ))
34848 }
34849 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
34850 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
34851 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
34852 LOGGING_DATA_ACKED_DATA::random(rng),
34853 )),
34854 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
34855 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
34856 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
34857 LOG_REQUEST_DATA_DATA::ID => {
34858 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
34859 }
34860 LOG_REQUEST_END_DATA::ID => {
34861 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
34862 }
34863 LOG_REQUEST_LIST_DATA::ID => {
34864 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
34865 }
34866 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
34867 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
34868 MANUAL_SETPOINT_DATA::ID => {
34869 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
34870 }
34871 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
34872 MESSAGE_INTERVAL_DATA::ID => {
34873 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
34874 }
34875 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
34876 MISSION_CLEAR_ALL_DATA::ID => {
34877 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
34878 }
34879 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
34880 MISSION_CURRENT_DATA::ID => {
34881 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
34882 }
34883 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
34884 MISSION_ITEM_INT_DATA::ID => {
34885 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
34886 }
34887 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34888 MISSION_ITEM_REACHED_DATA::random(rng),
34889 )),
34890 MISSION_REQUEST_DATA::ID => {
34891 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
34892 }
34893 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34894 MISSION_REQUEST_INT_DATA::random(rng),
34895 )),
34896 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34897 MISSION_REQUEST_LIST_DATA::random(rng),
34898 )),
34899 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34900 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
34901 )),
34902 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34903 MISSION_SET_CURRENT_DATA::random(rng),
34904 )),
34905 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34906 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
34907 )),
34908 MOUNT_ORIENTATION_DATA::ID => {
34909 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
34910 }
34911 NAMED_VALUE_FLOAT_DATA::ID => {
34912 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
34913 }
34914 NAMED_VALUE_INT_DATA::ID => {
34915 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
34916 }
34917 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34918 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
34919 )),
34920 OBSTACLE_DISTANCE_DATA::ID => {
34921 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
34922 }
34923 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
34924 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34925 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
34926 )),
34927 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34928 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
34929 )),
34930 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34931 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
34932 )),
34933 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34934 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
34935 )),
34936 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34937 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
34938 )),
34939 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34940 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
34941 )),
34942 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34943 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
34944 )),
34945 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34946 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
34947 )),
34948 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34949 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
34950 )),
34951 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34952 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
34953 )),
34954 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
34955 OPTICAL_FLOW_RAD_DATA::ID => {
34956 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
34957 }
34958 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34959 ORBIT_EXECUTION_STATUS_DATA::random(rng),
34960 )),
34961 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
34962 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34963 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
34964 )),
34965 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34966 PARAM_EXT_REQUEST_READ_DATA::random(rng),
34967 )),
34968 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
34969 PARAM_EXT_VALUE_DATA::ID => {
34970 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
34971 }
34972 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
34973 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
34974 PARAM_REQUEST_LIST_DATA::random(rng),
34975 )),
34976 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
34977 PARAM_REQUEST_READ_DATA::random(rng),
34978 )),
34979 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
34980 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
34981 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
34982 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
34983 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
34984 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34985 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34986 )),
34987 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34988 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34989 )),
34990 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
34991 PROTOCOL_VERSION_DATA::ID => {
34992 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
34993 }
34994 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
34995 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
34996 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
34997 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
34998 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
34999 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35000 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35001 )),
35002 RC_CHANNELS_RAW_DATA::ID => {
35003 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35004 }
35005 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35006 RC_CHANNELS_SCALED_DATA::random(rng),
35007 )),
35008 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35009 REQUEST_DATA_STREAM_DATA::random(rng),
35010 )),
35011 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35012 RESOURCE_REQUEST_DATA::ID => {
35013 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35014 }
35015 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35016 RESPONSE_EVENT_ERROR_DATA::random(rng),
35017 )),
35018 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35019 SAFETY_ALLOWED_AREA_DATA::random(rng),
35020 )),
35021 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35022 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35023 )),
35024 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35025 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35026 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35027 SCALED_PRESSURE_DATA::ID => {
35028 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35029 }
35030 SCALED_PRESSURE2_DATA::ID => {
35031 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35032 }
35033 SCALED_PRESSURE3_DATA::ID => {
35034 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35035 }
35036 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35037 SERVO_OUTPUT_RAW_DATA::ID => {
35038 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35039 }
35040 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35041 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35042 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35043 )),
35044 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35045 SET_ATTITUDE_TARGET_DATA::random(rng),
35046 )),
35047 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35048 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35049 )),
35050 SET_HOME_POSITION_DATA::ID => {
35051 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35052 }
35053 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35054 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35055 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35056 )),
35057 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35058 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35059 )),
35060 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35061 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35062 SMART_BATTERY_INFO_DATA::random(rng),
35063 )),
35064 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35065 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35066 STORAGE_INFORMATION_DATA::random(rng),
35067 )),
35068 SUPPORTED_TUNES_DATA::ID => {
35069 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35070 }
35071 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35072 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35073 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35074 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35075 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35076 TERRAIN_REQUEST_DATA::ID => {
35077 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35078 }
35079 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35080 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35081 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35082 )),
35083 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35084 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35085 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35086 ))
35087 }
35088 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35089 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35090 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35091 ))
35092 }
35093 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35094 UAVCAN_NODE_INFO_DATA::ID => {
35095 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35096 }
35097 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35098 UAVCAN_NODE_STATUS_DATA::random(rng),
35099 )),
35100 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35101 UTM_GLOBAL_POSITION_DATA::random(rng),
35102 )),
35103 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35104 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35105 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35106 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35107 VICON_POSITION_ESTIMATE_DATA::random(rng),
35108 )),
35109 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35110 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35111 )),
35112 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35113 VIDEO_STREAM_STATUS_DATA::random(rng),
35114 )),
35115 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35116 VISION_POSITION_ESTIMATE_DATA::random(rng),
35117 )),
35118 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35119 VISION_SPEED_ESTIMATE_DATA::random(rng),
35120 )),
35121 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35122 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35123 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35124 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35125 _ => None,
35126 }
35127 }
35128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35129 match self {
35130 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35131 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35132 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
35133 Self::AIS_VESSEL(body) => body.ser(version, bytes),
35134 Self::ALTITUDE(body) => body.ser(version, bytes),
35135 Self::ATTITUDE(body) => body.ser(version, bytes),
35136 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
35137 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35138 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
35139 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
35140 Self::AUTH_KEY(body) => body.ser(version, bytes),
35141 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
35142 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35143 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35144 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35145 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35146 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
35147 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
35148 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35149 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35150 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35151 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
35152 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35153 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
35154 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35155 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35156 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35157 Self::CANFD_FRAME(body) => body.ser(version, bytes),
35158 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
35159 Self::CAN_FRAME(body) => body.ser(version, bytes),
35160 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
35161 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
35162 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35163 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35164 Self::COLLISION(body) => body.ser(version, bytes),
35165 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35166 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35167 Self::COMMAND_INT(body) => body.ser(version, bytes),
35168 Self::COMMAND_LONG(body) => body.ser(version, bytes),
35169 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35170 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35171 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35172 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35173 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(body) => body.ser(version, bytes),
35174 Self::CUBEPILOT_FIRMWARE_UPDATE_START(body) => body.ser(version, bytes),
35175 Self::CUBEPILOT_RAW_RC(body) => body.ser(version, bytes),
35176 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35177 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35178 Self::DATA_STREAM(body) => body.ser(version, bytes),
35179 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
35180 Self::DEBUG(body) => body.ser(version, bytes),
35181 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35182 Self::DEBUG_VECT(body) => body.ser(version, bytes),
35183 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35184 Self::EFI_STATUS(body) => body.ser(version, bytes),
35185 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35186 Self::ESC_INFO(body) => body.ser(version, bytes),
35187 Self::ESC_STATUS(body) => body.ser(version, bytes),
35188 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35189 Self::EVENT(body) => body.ser(version, bytes),
35190 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
35191 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35192 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35193 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
35194 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
35195 Self::FUEL_STATUS(body) => body.ser(version, bytes),
35196 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
35197 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
35198 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
35199 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
35200 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
35201 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
35202 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
35203 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
35204 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
35205 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
35206 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
35207 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35208 Self::GPS2_RAW(body) => body.ser(version, bytes),
35209 Self::GPS2_RTK(body) => body.ser(version, bytes),
35210 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35211 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
35212 Self::GPS_INPUT(body) => body.ser(version, bytes),
35213 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
35214 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
35215 Self::GPS_RTK(body) => body.ser(version, bytes),
35216 Self::GPS_STATUS(body) => body.ser(version, bytes),
35217 Self::HEARTBEAT(body) => body.ser(version, bytes),
35218 Self::HERELINK_TELEM(body) => body.ser(version, bytes),
35219 Self::HERELINK_VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
35220 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
35221 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
35222 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
35223 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
35224 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
35225 Self::HIL_GPS(body) => body.ser(version, bytes),
35226 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
35227 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
35228 Self::HIL_SENSOR(body) => body.ser(version, bytes),
35229 Self::HIL_STATE(body) => body.ser(version, bytes),
35230 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
35231 Self::HOME_POSITION(body) => body.ser(version, bytes),
35232 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
35233 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
35234 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
35235 Self::LANDING_TARGET(body) => body.ser(version, bytes),
35236 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
35237 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
35238 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
35239 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
35240 Self::LOGGING_ACK(body) => body.ser(version, bytes),
35241 Self::LOGGING_DATA(body) => body.ser(version, bytes),
35242 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
35243 Self::LOG_DATA(body) => body.ser(version, bytes),
35244 Self::LOG_ENTRY(body) => body.ser(version, bytes),
35245 Self::LOG_ERASE(body) => body.ser(version, bytes),
35246 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
35247 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
35248 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
35249 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
35250 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
35251 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
35252 Self::MEMORY_VECT(body) => body.ser(version, bytes),
35253 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
35254 Self::MISSION_ACK(body) => body.ser(version, bytes),
35255 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
35256 Self::MISSION_COUNT(body) => body.ser(version, bytes),
35257 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
35258 Self::MISSION_ITEM(body) => body.ser(version, bytes),
35259 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
35260 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
35261 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
35262 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
35263 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
35264 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
35265 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
35266 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
35267 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
35268 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
35269 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
35270 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
35271 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
35272 Self::ODOMETRY(body) => body.ser(version, bytes),
35273 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
35274 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
35275 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
35276 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
35277 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
35278 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
35279 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
35280 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
35281 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
35282 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
35283 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
35284 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
35285 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
35286 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
35287 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
35288 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
35289 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
35290 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
35291 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
35292 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
35293 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
35294 Self::PARAM_SET(body) => body.ser(version, bytes),
35295 Self::PARAM_VALUE(body) => body.ser(version, bytes),
35296 Self::PING(body) => body.ser(version, bytes),
35297 Self::PLAY_TUNE(body) => body.ser(version, bytes),
35298 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
35299 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35300 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35301 Self::POWER_STATUS(body) => body.ser(version, bytes),
35302 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
35303 Self::RADIO_STATUS(body) => body.ser(version, bytes),
35304 Self::RAW_IMU(body) => body.ser(version, bytes),
35305 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
35306 Self::RAW_RPM(body) => body.ser(version, bytes),
35307 Self::RC_CHANNELS(body) => body.ser(version, bytes),
35308 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
35309 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
35310 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
35311 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
35312 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
35313 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
35314 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
35315 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
35316 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
35317 Self::SCALED_IMU(body) => body.ser(version, bytes),
35318 Self::SCALED_IMU2(body) => body.ser(version, bytes),
35319 Self::SCALED_IMU3(body) => body.ser(version, bytes),
35320 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
35321 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
35322 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
35323 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
35324 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
35325 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
35326 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35327 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
35328 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35329 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
35330 Self::SET_MODE(body) => body.ser(version, bytes),
35331 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35332 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35333 Self::SIM_STATE(body) => body.ser(version, bytes),
35334 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
35335 Self::STATUSTEXT(body) => body.ser(version, bytes),
35336 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
35337 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
35338 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
35339 Self::SYS_STATUS(body) => body.ser(version, bytes),
35340 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
35341 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
35342 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
35343 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
35344 Self::TIMESYNC(body) => body.ser(version, bytes),
35345 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
35346 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
35347 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
35348 Self::TUNNEL(body) => body.ser(version, bytes),
35349 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
35350 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
35351 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
35352 Self::V2_EXTENSION(body) => body.ser(version, bytes),
35353 Self::VFR_HUD(body) => body.ser(version, bytes),
35354 Self::VIBRATION(body) => body.ser(version, bytes),
35355 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35356 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
35357 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
35358 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35359 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
35360 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
35361 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
35362 Self::WINCH_STATUS(body) => body.ser(version, bytes),
35363 Self::WIND_COV(body) => body.ser(version, bytes),
35364 }
35365 }
35366 fn extra_crc(id: u32) -> u8 {
35367 match id {
35368 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35369 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
35370 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
35371 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
35372 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
35373 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
35374 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
35375 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
35376 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
35377 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
35378 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
35379 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35380 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
35381 }
35382 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
35383 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
35384 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
35385 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
35386 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
35387 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
35388 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
35389 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
35390 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
35391 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
35392 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
35393 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
35394 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
35395 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
35396 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
35397 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
35398 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
35399 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
35400 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
35401 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
35402 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
35403 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
35404 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
35405 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
35406 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
35407 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
35408 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
35409 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
35410 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
35411 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
35412 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
35413 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
35414 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::EXTRA_CRC
35415 }
35416 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
35417 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::EXTRA_CRC
35418 }
35419 CUBEPILOT_RAW_RC_DATA::ID => CUBEPILOT_RAW_RC_DATA::EXTRA_CRC,
35420 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
35421 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
35422 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
35423 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
35424 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
35425 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
35426 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
35427 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
35428 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
35429 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
35430 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
35431 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
35432 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
35433 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
35434 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
35435 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
35436 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
35437 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
35438 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
35439 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
35440 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
35441 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
35442 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
35443 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
35444 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
35445 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
35446 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35447 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
35448 }
35449 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
35450 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
35451 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
35452 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
35453 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35454 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
35455 }
35456 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
35457 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
35458 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35459 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
35460 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
35461 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
35462 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
35463 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
35464 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
35465 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
35466 HERELINK_TELEM_DATA::ID => HERELINK_TELEM_DATA::EXTRA_CRC,
35467 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
35468 HERELINK_VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC
35469 }
35470 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
35471 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
35472 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
35473 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
35474 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
35475 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
35476 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
35477 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
35478 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
35479 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
35480 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
35481 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
35482 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
35483 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
35484 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
35485 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
35486 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
35487 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
35488 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
35489 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35490 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
35491 }
35492 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
35493 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
35494 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
35495 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
35496 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
35497 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
35498 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
35499 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
35500 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
35501 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
35502 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
35503 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
35504 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
35505 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
35506 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
35507 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
35508 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
35509 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
35510 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
35511 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
35512 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
35513 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
35514 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
35515 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
35516 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
35517 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
35518 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
35519 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
35520 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
35521 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
35522 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
35523 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
35524 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
35525 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
35526 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
35527 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
35528 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
35529 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
35530 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
35531 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
35532 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
35533 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
35534 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
35535 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
35536 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
35537 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
35538 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
35539 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
35540 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
35541 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
35542 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
35543 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
35544 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
35545 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
35546 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
35547 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
35548 PING_DATA::ID => PING_DATA::EXTRA_CRC,
35549 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
35550 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
35551 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
35552 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35553 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
35554 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
35555 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
35556 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
35557 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
35558 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
35559 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
35560 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
35561 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
35562 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
35563 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
35564 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
35565 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
35566 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
35567 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
35568 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
35569 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
35570 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
35571 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
35572 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
35573 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
35574 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
35575 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
35576 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
35577 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
35578 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35579 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
35580 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35581 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
35582 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
35583 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35584 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
35585 }
35586 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35587 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
35588 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
35589 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
35590 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
35591 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
35592 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
35593 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
35594 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
35595 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
35596 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
35597 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
35598 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
35599 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
35600 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35601 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
35602 }
35603 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35604 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
35605 }
35606 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
35607 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
35608 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
35609 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
35610 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
35611 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
35612 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
35613 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35614 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
35615 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
35616 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35617 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
35618 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
35619 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
35620 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
35621 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
35622 _ => 0,
35623 }
35624 }
35625 fn target_system_id(&self) -> Option<u8> {
35626 match self {
35627 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
35628 Self::CANFD_FRAME(inner) => Some(inner.target_system),
35629 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
35630 Self::CAN_FRAME(inner) => Some(inner.target_system),
35631 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
35632 Self::COMMAND_ACK(inner) => Some(inner.target_system),
35633 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
35634 Self::COMMAND_INT(inner) => Some(inner.target_system),
35635 Self::COMMAND_LONG(inner) => Some(inner.target_system),
35636 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_system),
35637 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_system),
35638 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
35639 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
35640 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
35641 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
35642 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
35643 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
35644 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
35645 Self::LOGGING_ACK(inner) => Some(inner.target_system),
35646 Self::LOGGING_DATA(inner) => Some(inner.target_system),
35647 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
35648 Self::LOG_ERASE(inner) => Some(inner.target_system),
35649 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
35650 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
35651 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
35652 Self::MISSION_ACK(inner) => Some(inner.target_system),
35653 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
35654 Self::MISSION_COUNT(inner) => Some(inner.target_system),
35655 Self::MISSION_ITEM(inner) => Some(inner.target_system),
35656 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
35657 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
35658 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
35659 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
35660 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
35661 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
35662 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
35663 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
35664 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
35665 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
35666 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
35667 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
35668 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
35669 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
35670 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
35671 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
35672 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
35673 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
35674 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
35675 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
35676 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
35677 Self::PARAM_SET(inner) => Some(inner.target_system),
35678 Self::PING(inner) => Some(inner.target_system),
35679 Self::PLAY_TUNE(inner) => Some(inner.target_system),
35680 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
35681 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
35682 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
35683 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
35684 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
35685 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
35686 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
35687 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
35688 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
35689 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
35690 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
35691 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
35692 Self::SET_MODE(inner) => Some(inner.target_system),
35693 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
35694 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
35695 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
35696 Self::TIMESYNC(inner) => Some(inner.target_system),
35697 Self::TUNNEL(inner) => Some(inner.target_system),
35698 Self::V2_EXTENSION(inner) => Some(inner.target_system),
35699 _ => None,
35700 }
35701 }
35702 fn target_component_id(&self) -> Option<u8> {
35703 match self {
35704 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
35705 Self::CANFD_FRAME(inner) => Some(inner.target_component),
35706 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
35707 Self::CAN_FRAME(inner) => Some(inner.target_component),
35708 Self::COMMAND_ACK(inner) => Some(inner.target_component),
35709 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
35710 Self::COMMAND_INT(inner) => Some(inner.target_component),
35711 Self::COMMAND_LONG(inner) => Some(inner.target_component),
35712 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_component),
35713 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_component),
35714 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
35715 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
35716 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
35717 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
35718 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
35719 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
35720 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
35721 Self::LOGGING_ACK(inner) => Some(inner.target_component),
35722 Self::LOGGING_DATA(inner) => Some(inner.target_component),
35723 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
35724 Self::LOG_ERASE(inner) => Some(inner.target_component),
35725 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
35726 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
35727 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
35728 Self::MISSION_ACK(inner) => Some(inner.target_component),
35729 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
35730 Self::MISSION_COUNT(inner) => Some(inner.target_component),
35731 Self::MISSION_ITEM(inner) => Some(inner.target_component),
35732 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
35733 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
35734 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
35735 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
35736 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
35737 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
35738 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
35739 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
35740 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
35741 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
35742 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
35743 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
35744 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
35745 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
35746 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
35747 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
35748 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
35749 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
35750 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
35751 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
35752 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
35753 Self::PARAM_SET(inner) => Some(inner.target_component),
35754 Self::PING(inner) => Some(inner.target_component),
35755 Self::PLAY_TUNE(inner) => Some(inner.target_component),
35756 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
35757 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
35758 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
35759 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
35760 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
35761 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
35762 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
35763 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
35764 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
35765 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
35766 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
35767 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
35768 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
35769 Self::TIMESYNC(inner) => Some(inner.target_component),
35770 Self::TUNNEL(inner) => Some(inner.target_component),
35771 Self::V2_EXTENSION(inner) => Some(inner.target_component),
35772 _ => None,
35773 }
35774 }
35775}